Skip to content

Commit 2f3067e

Browse files
[llvm] Remove unused local variables (NFC) (#138454)
1 parent d144c13 commit 2f3067e

File tree

17 files changed

+2
-27
lines changed

17 files changed

+2
-27
lines changed

llvm/include/llvm/CodeGen/SDPatternMatch.h

-1
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,6 @@ template <typename... PatternTs> struct ReassociatableOpc_match {
11561156
// std::get<J>(Patterns)) == true
11571157
std::array<SmallBitVector, NumPatterns> Matches;
11581158
for (size_t I = 0; I != NumPatterns; I++) {
1159-
SmallVector<bool> MatchResults;
11601159
std::apply(
11611160
[&](auto &...P) {
11621161
(Matches[I].push_back(sd_context_match(Leaves[I], Ctx, P)), ...);

llvm/include/llvm/Support/GenericLoopInfoImpl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ void LoopInfoBase<BlockT, LoopT>::analyze(const DomTreeBase<BlockT> &DomTree) {
604604
template <class BlockT, class LoopT>
605605
SmallVector<LoopT *, 4>
606606
LoopInfoBase<BlockT, LoopT>::getLoopsInPreorder() const {
607-
SmallVector<LoopT *, 4> PreOrderLoops, PreOrderWorklist;
607+
SmallVector<LoopT *, 4> PreOrderLoops;
608608
// The outer-most loop actually goes into the result in the same relative
609609
// order as we walk it. But LoopInfo stores the top level loops in reverse
610610
// program order so for here we reverse it to get forward program order.

llvm/lib/Analysis/BranchProbabilityInfo.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,6 @@ BranchProbabilityInfo::getEstimatedEdgeWeight(const LoopEdge &Edge) const {
666666
template <class IterT>
667667
std::optional<uint32_t> BranchProbabilityInfo::getMaxEstimatedEdgeWeight(
668668
const LoopBlock &SrcLoopBB, iterator_range<IterT> Successors) const {
669-
SmallVector<uint32_t, 4> Weights;
670669
std::optional<uint32_t> MaxWeight;
671670
for (const BasicBlock *DstBB : Successors) {
672671
const LoopBlock DstLoopBB = getLoopBlock(DstBB);

llvm/lib/Analysis/LoopAccessAnalysis.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -1426,9 +1426,6 @@ void AccessAnalysis::processMemAccesses() {
14261426

14271427
// Create sets of pointers connected by a shared alias set and
14281428
// underlying object.
1429-
typedef SmallVector<const Value *, 16> ValueVector;
1430-
ValueVector TempObjects;
1431-
14321429
SmallVector<const Value *, 16> &UOs = UnderlyingObjects[Ptr];
14331430
UOs = {};
14341431
::getUnderlyingObjects(Ptr, UOs, LI);

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -3997,8 +3997,6 @@ Error BitcodeReader::rememberAndSkipFunctionBodies() {
39973997
// finished the parse greedily.
39983998
assert(SeenValueSymbolTable);
39993999

4000-
SmallVector<uint64_t, 64> Record;
4001-
40024000
while (true) {
40034001
Expected<llvm::BitstreamEntry> MaybeEntry = Stream.advance();
40044002
if (!MaybeEntry)

llvm/lib/ExecutionEngine/Orc/GetDylibInterface.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ Expected<SymbolNameSet> getDylibInterface(ExecutionSession &ES, Twine Path) {
111111
if (auto EC = identify_magic(Path, Magic))
112112
return createFileError(Path, EC);
113113

114-
SymbolNameSet Symbols;
115114
switch (Magic) {
116115
case file_magic::macho_universal_binary:
117116
case file_magic::macho_dynamically_linked_shared_lib:

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -4607,8 +4607,6 @@ OpenMPIRBuilder::applyWorkshareLoopTarget(DebugLoc DL, CanonicalLoopInfo *CLI,
46074607
SmallPtrSet<BasicBlock *, 32> ParallelRegionBlockSet;
46084608
SmallVector<BasicBlock *, 32> Blocks;
46094609
OI.collectBlocks(ParallelRegionBlockSet, Blocks);
4610-
SmallVector<BasicBlock *, 32> BlocksT(ParallelRegionBlockSet.begin(),
4611-
ParallelRegionBlockSet.end());
46124610

46134611
CodeExtractorAnalysisCache CEAC(*OuterFn);
46144612
CodeExtractor Extractor(Blocks,
@@ -4624,7 +4622,7 @@ OpenMPIRBuilder::applyWorkshareLoopTarget(DebugLoc DL, CanonicalLoopInfo *CLI,
46244622
/* AggrArgsIn0AddrSpace */ true);
46254623

46264624
BasicBlock *CommonExit = nullptr;
4627-
SetVector<Value *> Inputs, Outputs, SinkingCands, HoistingCands;
4625+
SetVector<Value *> SinkingCands, HoistingCands;
46284626

46294627
// Find allocas outside the loop body region which are used inside loop
46304628
// body

llvm/lib/IR/SafepointIRVerifier.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ class CFGDeadness {
157157
protected:
158158
void addDeadBlock(const BasicBlock *BB) {
159159
SmallVector<const BasicBlock *, 4> NewDead;
160-
SmallSetVector<const BasicBlock *, 4> DF;
161160

162161
NewDead.push_back(BB);
163162
while (!NewDead.empty()) {

llvm/lib/ObjCopy/CommonConfig.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ NameOrPattern::create(StringRef Pattern, MatchStyle MS,
1919
case MatchStyle::Literal:
2020
return NameOrPattern(Pattern);
2121
case MatchStyle::Wildcard: {
22-
SmallVector<char, 32> Data;
2322
bool IsPositiveMatch = !Pattern.consume_front("!");
2423
Expected<GlobPattern> GlobOrErr = GlobPattern::create(Pattern);
2524

llvm/lib/ProfileData/InstrProf.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,6 @@ Error InstrProfSymtab::create(Module &M, bool InLTO, bool AddCanonical) {
537537
return E;
538538
}
539539

540-
SmallVector<MDNode *, 2> Types;
541540
for (GlobalVariable &G : M.globals()) {
542541
if (!G.hasName() || !G.hasMetadata(LLVMContext::MD_type))
543542
continue;

llvm/tools/dsymutil/DwarfLinkerForBinary.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ Error DwarfLinkerForBinary::emitRelocations(
202202
Obj.OutRelocs->addValidRelocs(RM);
203203
}
204204

205-
SmallString<128> InputPath;
206205
SmallString<128> Path;
207206
// Create the "Relocations" directory in the "Resources" directory, and
208207
// create an architecture-specific directory in the "Relocations" directory.
@@ -233,7 +232,6 @@ static Error emitRemarks(const LinkOptions &Options, StringRef BinaryPath,
233232
if (RL.empty())
234233
return Error::success();
235234

236-
SmallString<128> InputPath;
237235
SmallString<128> Path;
238236
// Create the "Remarks" directory in the "Resources" directory.
239237
sys::path::append(Path, *Options.ResourceDir, "Remarks");

llvm/tools/llvm-exegesis/lib/ParallelSnippetGenerator.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ namespace llvm {
8080
namespace exegesis {
8181

8282
static bool hasVariablesWithTiedOperands(const Instruction &Instr) {
83-
SmallVector<const Variable *, 8> Result;
8483
for (const auto &Var : Instr.Variables)
8584
if (Var.hasTiedOperands())
8685
return true;

llvm/unittests/Analysis/MemorySSATest.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,6 @@ TEST_F(MemorySSATest, Irreducible) {
874874
// }
875875
// use(x)
876876

877-
SmallVector<PHINode *, 8> Inserted;
878877
IRBuilder<> B(C);
879878
F = Function::Create(FunctionType::get(B.getVoidTy(), {B.getPtrTy()}, false),
880879
GlobalValue::ExternalLinkage, "F", &M);

llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -1590,8 +1590,6 @@ TEST_F(CoreAPIsStandardTest, TestGetRequestedSymbolsAndReplace) {
15901590
// have pending queries, and test that MaterializationResponsibility's
15911591
// replace method can be used to return definitions to the JITDylib in a new
15921592
// MaterializationUnit.
1593-
SymbolNameSet Names({Foo, Bar});
1594-
15951593
bool FooMaterialized = false;
15961594
bool BarMaterialized = false;
15971595

llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -2347,7 +2347,6 @@ TEST_F(OpenMPIRBuilderTest, UnrollLoopHeuristic) {
23472347

23482348
TEST_F(OpenMPIRBuilderTest, StaticWorkshareLoopTarget) {
23492349
using InsertPointTy = OpenMPIRBuilder::InsertPointTy;
2350-
std::string oldDLStr = M->getDataLayoutStr();
23512350
M->setDataLayout(
23522351
"e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:"
23532352
"256:256:32-p8:128:128-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:"
@@ -5554,7 +5553,6 @@ TEST_F(OpenMPIRBuilderTest, CreateSectionsSimple) {
55545553
OpenMPIRBuilder::LocationDescription Loc({Builder.saveIP(), DL});
55555554

55565555
llvm::SmallVector<BodyGenCallbackTy, 4> SectionCBVector;
5557-
llvm::SmallVector<BasicBlock *, 4> CaseBBs;
55585556

55595557
auto FiniCB = [&](InsertPointTy IP) { return Error::success(); };
55605558
auto SectionCB = [&](InsertPointTy AllocaIP, InsertPointTy CodeGenIP) {

llvm/unittests/IR/DominatorTreeTest.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,6 @@ TEST(DominatorTree, IDFDeterminismTest) {
681681
IDF.setDefiningBlocks(DefBlocks);
682682

683683
SmallVector<BasicBlock *, 32> IDFBlocks;
684-
SmallPtrSet<BasicBlock *, 32> LiveInBlocks;
685684
IDF.resetLiveInBlocks();
686685
IDF.calculate(IDFBlocks);
687686

llvm/unittests/Support/Path.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,6 @@ TEST_F(FileSystemTest, RealPathNoReadPerm) {
824824
ASSERT_NO_ERROR(fs::remove_directories(Twine(TestDirectory) + "/noreadperm"));
825825
}
826826
TEST_F(FileSystemTest, RemoveDirectoriesNoExePerm) {
827-
SmallString<64> Expanded;
828-
829827
ASSERT_NO_ERROR(
830828
fs::create_directories(Twine(TestDirectory) + "/noexeperm/foo"));
831829
ASSERT_TRUE(fs::exists(Twine(TestDirectory) + "/noexeperm/foo"));
@@ -965,7 +963,6 @@ TEST_F(FileSystemTest, TempFileCollisions) {
965963
FileRemover Cleanup(TestDirectory);
966964
SmallString<128> Model = TestDirectory;
967965
path::append(Model, "%.tmp");
968-
SmallString<128> Path;
969966
std::vector<fs::TempFile> TempFiles;
970967

971968
auto TryCreateTempFile = [&]() {

0 commit comments

Comments
 (0)