Skip to content

[llvm] Remove unused local variables (NFC) #138454

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion llvm/include/llvm/CodeGen/SDPatternMatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,6 @@ template <typename... PatternTs> struct ReassociatableOpc_match {
// std::get<J>(Patterns)) == true
std::array<SmallBitVector, NumPatterns> Matches;
for (size_t I = 0; I != NumPatterns; I++) {
SmallVector<bool> MatchResults;
std::apply(
[&](auto &...P) {
(Matches[I].push_back(sd_context_match(Leaves[I], Ctx, P)), ...);
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/Support/GenericLoopInfoImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ void LoopInfoBase<BlockT, LoopT>::analyze(const DomTreeBase<BlockT> &DomTree) {
template <class BlockT, class LoopT>
SmallVector<LoopT *, 4>
LoopInfoBase<BlockT, LoopT>::getLoopsInPreorder() const {
SmallVector<LoopT *, 4> PreOrderLoops, PreOrderWorklist;
SmallVector<LoopT *, 4> PreOrderLoops;
// The outer-most loop actually goes into the result in the same relative
// order as we walk it. But LoopInfo stores the top level loops in reverse
// program order so for here we reverse it to get forward program order.
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Analysis/BranchProbabilityInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,6 @@ BranchProbabilityInfo::getEstimatedEdgeWeight(const LoopEdge &Edge) const {
template <class IterT>
std::optional<uint32_t> BranchProbabilityInfo::getMaxEstimatedEdgeWeight(
const LoopBlock &SrcLoopBB, iterator_range<IterT> Successors) const {
SmallVector<uint32_t, 4> Weights;
std::optional<uint32_t> MaxWeight;
for (const BasicBlock *DstBB : Successors) {
const LoopBlock DstLoopBB = getLoopBlock(DstBB);
Expand Down
3 changes: 0 additions & 3 deletions llvm/lib/Analysis/LoopAccessAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1426,9 +1426,6 @@ void AccessAnalysis::processMemAccesses() {

// Create sets of pointers connected by a shared alias set and
// underlying object.
typedef SmallVector<const Value *, 16> ValueVector;
ValueVector TempObjects;

SmallVector<const Value *, 16> &UOs = UnderlyingObjects[Ptr];
UOs = {};
::getUnderlyingObjects(Ptr, UOs, LI);
Expand Down
2 changes: 0 additions & 2 deletions llvm/lib/Bitcode/Reader/BitcodeReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3997,8 +3997,6 @@ Error BitcodeReader::rememberAndSkipFunctionBodies() {
// finished the parse greedily.
assert(SeenValueSymbolTable);

SmallVector<uint64_t, 64> Record;

while (true) {
Expected<llvm::BitstreamEntry> MaybeEntry = Stream.advance();
if (!MaybeEntry)
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/ExecutionEngine/Orc/GetDylibInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ Expected<SymbolNameSet> getDylibInterface(ExecutionSession &ES, Twine Path) {
if (auto EC = identify_magic(Path, Magic))
return createFileError(Path, EC);

SymbolNameSet Symbols;
switch (Magic) {
case file_magic::macho_universal_binary:
case file_magic::macho_dynamically_linked_shared_lib:
Expand Down
4 changes: 1 addition & 3 deletions llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4607,8 +4607,6 @@ OpenMPIRBuilder::applyWorkshareLoopTarget(DebugLoc DL, CanonicalLoopInfo *CLI,
SmallPtrSet<BasicBlock *, 32> ParallelRegionBlockSet;
SmallVector<BasicBlock *, 32> Blocks;
OI.collectBlocks(ParallelRegionBlockSet, Blocks);
SmallVector<BasicBlock *, 32> BlocksT(ParallelRegionBlockSet.begin(),
ParallelRegionBlockSet.end());

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

BasicBlock *CommonExit = nullptr;
SetVector<Value *> Inputs, Outputs, SinkingCands, HoistingCands;
SetVector<Value *> SinkingCands, HoistingCands;

// Find allocas outside the loop body region which are used inside loop
// body
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/IR/SafepointIRVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ class CFGDeadness {
protected:
void addDeadBlock(const BasicBlock *BB) {
SmallVector<const BasicBlock *, 4> NewDead;
SmallSetVector<const BasicBlock *, 4> DF;

NewDead.push_back(BB);
while (!NewDead.empty()) {
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/ObjCopy/CommonConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ NameOrPattern::create(StringRef Pattern, MatchStyle MS,
case MatchStyle::Literal:
return NameOrPattern(Pattern);
case MatchStyle::Wildcard: {
SmallVector<char, 32> Data;
bool IsPositiveMatch = !Pattern.consume_front("!");
Expected<GlobPattern> GlobOrErr = GlobPattern::create(Pattern);

Expand Down
1 change: 0 additions & 1 deletion llvm/lib/ProfileData/InstrProf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,6 @@ Error InstrProfSymtab::create(Module &M, bool InLTO, bool AddCanonical) {
return E;
}

SmallVector<MDNode *, 2> Types;
for (GlobalVariable &G : M.globals()) {
if (!G.hasName() || !G.hasMetadata(LLVMContext::MD_type))
continue;
Expand Down
2 changes: 0 additions & 2 deletions llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ Error DwarfLinkerForBinary::emitRelocations(
Obj.OutRelocs->addValidRelocs(RM);
}

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

SmallString<128> InputPath;
SmallString<128> Path;
// Create the "Remarks" directory in the "Resources" directory.
sys::path::append(Path, *Options.ResourceDir, "Remarks");
Expand Down
1 change: 0 additions & 1 deletion llvm/tools/llvm-exegesis/lib/ParallelSnippetGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ namespace llvm {
namespace exegesis {

static bool hasVariablesWithTiedOperands(const Instruction &Instr) {
SmallVector<const Variable *, 8> Result;
for (const auto &Var : Instr.Variables)
if (Var.hasTiedOperands())
return true;
Expand Down
1 change: 0 additions & 1 deletion llvm/unittests/Analysis/MemorySSATest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,6 @@ TEST_F(MemorySSATest, Irreducible) {
// }
// use(x)

SmallVector<PHINode *, 8> Inserted;
IRBuilder<> B(C);
F = Function::Create(FunctionType::get(B.getVoidTy(), {B.getPtrTy()}, false),
GlobalValue::ExternalLinkage, "F", &M);
Expand Down
2 changes: 0 additions & 2 deletions llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1590,8 +1590,6 @@ TEST_F(CoreAPIsStandardTest, TestGetRequestedSymbolsAndReplace) {
// have pending queries, and test that MaterializationResponsibility's
// replace method can be used to return definitions to the JITDylib in a new
// MaterializationUnit.
SymbolNameSet Names({Foo, Bar});

bool FooMaterialized = false;
bool BarMaterialized = false;

Expand Down
2 changes: 0 additions & 2 deletions llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2347,7 +2347,6 @@ TEST_F(OpenMPIRBuilderTest, UnrollLoopHeuristic) {

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

llvm::SmallVector<BodyGenCallbackTy, 4> SectionCBVector;
llvm::SmallVector<BasicBlock *, 4> CaseBBs;

auto FiniCB = [&](InsertPointTy IP) { return Error::success(); };
auto SectionCB = [&](InsertPointTy AllocaIP, InsertPointTy CodeGenIP) {
Expand Down
1 change: 0 additions & 1 deletion llvm/unittests/IR/DominatorTreeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,6 @@ TEST(DominatorTree, IDFDeterminismTest) {
IDF.setDefiningBlocks(DefBlocks);

SmallVector<BasicBlock *, 32> IDFBlocks;
SmallPtrSet<BasicBlock *, 32> LiveInBlocks;
IDF.resetLiveInBlocks();
IDF.calculate(IDFBlocks);

Expand Down
3 changes: 0 additions & 3 deletions llvm/unittests/Support/Path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -824,8 +824,6 @@ TEST_F(FileSystemTest, RealPathNoReadPerm) {
ASSERT_NO_ERROR(fs::remove_directories(Twine(TestDirectory) + "/noreadperm"));
}
TEST_F(FileSystemTest, RemoveDirectoriesNoExePerm) {
SmallString<64> Expanded;

ASSERT_NO_ERROR(
fs::create_directories(Twine(TestDirectory) + "/noexeperm/foo"));
ASSERT_TRUE(fs::exists(Twine(TestDirectory) + "/noexeperm/foo"));
Expand Down Expand Up @@ -965,7 +963,6 @@ TEST_F(FileSystemTest, TempFileCollisions) {
FileRemover Cleanup(TestDirectory);
SmallString<128> Model = TestDirectory;
path::append(Model, "%.tmp");
SmallString<128> Path;
std::vector<fs::TempFile> TempFiles;

auto TryCreateTempFile = [&]() {
Expand Down