From 55945aaf0badcce4037dd081a857fdaed4d4cab9 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 6 Nov 2025 08:02:25 -0800 Subject: [PATCH] [llvm] Remove unused local variables (NFC) Identified with bugprone-unused-local-non-trivial-variable. --- llvm/lib/CAS/UnifiedOnDiskCache.cpp | 2 -- llvm/lib/CodeGen/WindowsSecureHotPatching.cpp | 2 -- llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp | 1 - llvm/lib/Transforms/IPO/SampleProfile.cpp | 1 - llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 2 -- 5 files changed, 8 deletions(-) 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 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 &GVLoadMap, SmallVector &GVUses) { - SmallVector ReplacedOperands; - if (GlobalVariable *GV = dyn_cast(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 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 OwnedORE; auto &FAM = AM.getResult(*F.getParent()) .getManager(); ORE = &FAM.getResult(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(P.first->Scalars.size()) && "Couldn't find extract lane"); - SmallVector OpIndices; for (unsigned OpIdx : seq(::getNumberOfPotentiallyCommutativeOps( P.first->getMainOp()))) { @@ -8815,7 +8814,6 @@ void BoUpSLP::buildExternalUses( const ExtraValueToDebugLocsMap &ExternallyUsedValues) { const size_t NumVectScalars = ScalarToTreeEntries.size() + 1; DenseMap ScalarToExtUses; - SmallPtrSet ExternalUsers; // Collect the values that we need to extract from the tree. for (auto &TEPtr : VectorizableTree) { TreeEntry *Entry = TEPtr.get();