-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[llvm] Remove unused local variables (NFC) #167106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[llvm] Remove unused local variables (NFC) #167106
Conversation
Identified with bugprone-unused-local-non-trivial-variable.
|
@llvm/pr-subscribers-vectorizers @llvm/pr-subscribers-backend-arm Author: Kazu Hirata (kazutakahirata) ChangesIdentified with bugprone-unused-local-non-trivial-variable. Full diff: https://github.com/llvm/llvm-project/pull/167106.diff 5 Files Affected:
diff --git a/llvm/lib/CAS/UnifiedOnDiskCache.cpp b/llvm/lib/CAS/UnifiedOnDiskCache.cpp
index 7b790bb005ce9..e6b676accb0fe 100644
--- a/llvm/lib/CAS/UnifiedOnDiskCache.cpp
+++ b/llvm/lib/CAS/UnifiedOnDiskCache.cpp
@@ -331,8 +331,6 @@ Expected<ValidationResult> UnifiedOnDiskCache::validateIfNeeded(
if (Error E = getBootTime().moveInto(BootTime))
return std::move(E);
- std::string LogValidationError;
-
if (ValidationBootTime == BootTime && !ForceValidation)
return ValidationResult::Skipped;
diff --git a/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp b/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp
index fd54190b04468..dab1416d254a2 100644
--- a/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp
+++ b/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp
@@ -461,8 +461,6 @@ static bool searchConstantExprForGlobalVariables(
Value *V, SmallDenseMap<GlobalVariable *, Value *> &GVLoadMap,
SmallVector<GlobalVariableUse> &GVUses) {
- SmallVector<Value *, 8> ReplacedOperands;
-
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
if (globalVariableNeedsRedirect(GV)) {
GVLoadMap[GV] = nullptr;
diff --git a/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp b/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
index 597d311989b2f..1719165fb6717 100644
--- a/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
+++ b/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
@@ -1051,7 +1051,6 @@ bool LowOverheadLoop::ValidateLiveOuts() {
// check where it gets its false lanes from, if any.
int InactiveIdx = findVPTInactiveOperandIdx(*MI);
if (InactiveIdx != -1) {
- SmallPtrSet<MachineInstr *, 2> Defs;
MachineInstr *FalseSrc = RDI.getUniqueReachingMIDef(
MI, MI->getOperand(InactiveIdx).getReg());
if (FalseSrc) {
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp
index e39e311dd795f..bd74388aaf217 100644
--- a/llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -2293,7 +2293,6 @@ bool SampleProfileLoader::runOnFunction(Function &F,
// count value.
if (!F.getEntryCount())
F.setEntryCount(ProfileCount(initialEntryCount, Function::PCT_Real));
- std::unique_ptr<OptimizationRemarkEmitter> OwnedORE;
auto &FAM = AM.getResult<FunctionAnalysisManagerModuleProxy>(*F.getParent())
.getManager();
ORE = &FAM.getResult<OptimizationRemarkEmitterAnalysis>(F);
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index df835a077f2a0..c27d1ac99dd80 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -5368,7 +5368,6 @@ class BoUpSLP {
Lane = P.first->ReorderIndices[Lane];
assert(Lane < static_cast<int>(P.first->Scalars.size()) &&
"Couldn't find extract lane");
- SmallVector<unsigned> OpIndices;
for (unsigned OpIdx :
seq<unsigned>(::getNumberOfPotentiallyCommutativeOps(
P.first->getMainOp()))) {
@@ -8815,7 +8814,6 @@ void BoUpSLP::buildExternalUses(
const ExtraValueToDebugLocsMap &ExternallyUsedValues) {
const size_t NumVectScalars = ScalarToTreeEntries.size() + 1;
DenseMap<Value *, unsigned> ScalarToExtUses;
- SmallPtrSet<Value *, 4> ExternalUsers;
// Collect the values that we need to extract from the tree.
for (auto &TEPtr : VectorizableTree) {
TreeEntry *Entry = TEPtr.get();
|
|
@llvm/pr-subscribers-pgo Author: Kazu Hirata (kazutakahirata) ChangesIdentified with bugprone-unused-local-non-trivial-variable. Full diff: https://github.com/llvm/llvm-project/pull/167106.diff 5 Files Affected:
diff --git a/llvm/lib/CAS/UnifiedOnDiskCache.cpp b/llvm/lib/CAS/UnifiedOnDiskCache.cpp
index 7b790bb005ce9..e6b676accb0fe 100644
--- a/llvm/lib/CAS/UnifiedOnDiskCache.cpp
+++ b/llvm/lib/CAS/UnifiedOnDiskCache.cpp
@@ -331,8 +331,6 @@ Expected<ValidationResult> UnifiedOnDiskCache::validateIfNeeded(
if (Error E = getBootTime().moveInto(BootTime))
return std::move(E);
- std::string LogValidationError;
-
if (ValidationBootTime == BootTime && !ForceValidation)
return ValidationResult::Skipped;
diff --git a/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp b/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp
index fd54190b04468..dab1416d254a2 100644
--- a/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp
+++ b/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp
@@ -461,8 +461,6 @@ static bool searchConstantExprForGlobalVariables(
Value *V, SmallDenseMap<GlobalVariable *, Value *> &GVLoadMap,
SmallVector<GlobalVariableUse> &GVUses) {
- SmallVector<Value *, 8> ReplacedOperands;
-
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
if (globalVariableNeedsRedirect(GV)) {
GVLoadMap[GV] = nullptr;
diff --git a/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp b/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
index 597d311989b2f..1719165fb6717 100644
--- a/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
+++ b/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
@@ -1051,7 +1051,6 @@ bool LowOverheadLoop::ValidateLiveOuts() {
// check where it gets its false lanes from, if any.
int InactiveIdx = findVPTInactiveOperandIdx(*MI);
if (InactiveIdx != -1) {
- SmallPtrSet<MachineInstr *, 2> Defs;
MachineInstr *FalseSrc = RDI.getUniqueReachingMIDef(
MI, MI->getOperand(InactiveIdx).getReg());
if (FalseSrc) {
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp
index e39e311dd795f..bd74388aaf217 100644
--- a/llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -2293,7 +2293,6 @@ bool SampleProfileLoader::runOnFunction(Function &F,
// count value.
if (!F.getEntryCount())
F.setEntryCount(ProfileCount(initialEntryCount, Function::PCT_Real));
- std::unique_ptr<OptimizationRemarkEmitter> OwnedORE;
auto &FAM = AM.getResult<FunctionAnalysisManagerModuleProxy>(*F.getParent())
.getManager();
ORE = &FAM.getResult<OptimizationRemarkEmitterAnalysis>(F);
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index df835a077f2a0..c27d1ac99dd80 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -5368,7 +5368,6 @@ class BoUpSLP {
Lane = P.first->ReorderIndices[Lane];
assert(Lane < static_cast<int>(P.first->Scalars.size()) &&
"Couldn't find extract lane");
- SmallVector<unsigned> OpIndices;
for (unsigned OpIdx :
seq<unsigned>(::getNumberOfPotentiallyCommutativeOps(
P.first->getMainOp()))) {
@@ -8815,7 +8814,6 @@ void BoUpSLP::buildExternalUses(
const ExtraValueToDebugLocsMap &ExternallyUsedValues) {
const size_t NumVectScalars = ScalarToTreeEntries.size() + 1;
DenseMap<Value *, unsigned> ScalarToExtUses;
- SmallPtrSet<Value *, 4> ExternalUsers;
// Collect the values that we need to extract from the tree.
for (auto &TEPtr : VectorizableTree) {
TreeEntry *Entry = TEPtr.get();
|
Identified with bugprone-unused-local-non-trivial-variable.
Identified with bugprone-unused-local-non-trivial-variable.