Skip to content

Commit 6ab7cb7

Browse files
[Transforms] Remove unused local variables (NFC) (#138442)
1 parent 47f391f commit 6ab7cb7

12 files changed

+3
-24
lines changed

llvm/lib/Transforms/IPO/FunctionImport.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,6 @@ class WorkloadImportsManager : public ModuleImportsManager {
578578
GlobalsImporter GVI(Index, DefinedGVSummaries, IsPrevailing, ImportList,
579579
ExportLists);
580580
auto &ValueInfos = SetIter->second;
581-
SmallVector<EdgeInfo, 128> GlobWorklist;
582581
for (auto &VI : llvm::make_early_inc_range(ValueInfos)) {
583582
auto It = DefinedGVSummaries.find(VI.getGUID());
584583
if (It != DefinedGVSummaries.end() &&

llvm/lib/Transforms/IPO/IROutliner.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2702,7 +2702,7 @@ void IROutliner::updateOutputMapping(OutlinableRegion &Region,
27022702
}
27032703

27042704
bool IROutliner::extractSection(OutlinableRegion &Region) {
2705-
SetVector<Value *> ArgInputs, Outputs, SinkCands;
2705+
SetVector<Value *> ArgInputs, Outputs;
27062706
assert(Region.StartBB && "StartBB for the OutlinableRegion is nullptr!");
27072707
BasicBlock *InitialStart = Region.StartBB;
27082708
Function *OrigF = Region.StartBB->getParent();

llvm/lib/Transforms/IPO/Internalize.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ bool InternalizePass::shouldPreserveGV(const GlobalValue &GV) {
132132

133133
bool InternalizePass::maybeInternalize(
134134
GlobalValue &GV, DenseMap<const Comdat *, ComdatInfo> &ComdatMap) {
135-
SmallString<0> ComdatName;
136135
if (Comdat *C = GV.getComdat()) {
137136
// For GlobalAlias, C is the aliasee object's comdat which may have been
138137
// redirected. So ComdatMap may not contain C.

llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -2040,8 +2040,6 @@ bool NumericalStabilitySanitizer::sanitizeFunction(
20402040
// the module constructor.
20412041
if (F.getName() == kNsanModuleCtorName)
20422042
return false;
2043-
SmallVector<Instruction *, 8> AllLoadsAndStores;
2044-
SmallVector<Instruction *, 8> LocalLoadsAndStores;
20452043

20462044
// The instrumentation maintains:
20472045
// - for each IR value `v` of floating-point (or vector floating-point) type

llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -2301,11 +2301,8 @@ FindPredecessorRetainWithSafePath(const Value *Arg, BasicBlock *BB,
23012301
/// Look for an ``autorelease'' instruction dependent on Arg such that there are
23022302
/// no instructions dependent on Arg that need a positive ref count in between
23032303
/// the autorelease and the ret.
2304-
static CallInst *
2305-
FindPredecessorAutoreleaseWithSafePath(const Value *Arg, BasicBlock *BB,
2306-
ReturnInst *Ret,
2307-
ProvenanceAnalysis &PA) {
2308-
SmallPtrSet<Instruction *, 4> DepInsts;
2304+
static CallInst *FindPredecessorAutoreleaseWithSafePath(
2305+
const Value *Arg, BasicBlock *BB, ReturnInst *Ret, ProvenanceAnalysis &PA) {
23092306
auto *Autorelease = dyn_cast_or_null<CallInst>(
23102307
findSingleDependency(NeedsPositiveRetainCount, Arg, BB, Ret, PA));
23112308

llvm/lib/Transforms/Scalar/LoopInterchange.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,6 @@ bool LoopInterchangeTransform::transform() {
14631463
BasicBlock *InnerLoopPreHeader = InnerLoop->getLoopPreheader();
14641464
BasicBlock *OuterLoopHeader = OuterLoop->getHeader();
14651465
if (InnerLoopPreHeader != OuterLoopHeader) {
1466-
SmallPtrSet<Instruction *, 4> NeedsMoving;
14671466
for (Instruction &I :
14681467
make_early_inc_range(make_range(InnerLoopPreHeader->begin(),
14691468
std::prev(InnerLoopPreHeader->end()))))

llvm/lib/Transforms/Scalar/NewGVN.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -2737,7 +2737,6 @@ NewGVN::makePossiblePHIOfOps(Instruction *I,
27372737
if (!isCycleFree(I))
27382738
return nullptr;
27392739

2740-
SmallPtrSet<const Value *, 8> ProcessedPHIs;
27412740
// TODO: We don't do phi translation on memory accesses because it's
27422741
// complicated. For a load, we'd need to be able to simulate a new memoryuse,
27432742
// which we don't have a good way of doing ATM.

llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -2762,7 +2762,6 @@ static BranchInst *turnSelectIntoBranch(SelectInst *SI, DominatorTree &DT,
27622762
static BranchInst *turnGuardIntoBranch(IntrinsicInst *GI, Loop &L,
27632763
DominatorTree &DT, LoopInfo &LI,
27642764
MemorySSAUpdater *MSSAU) {
2765-
SmallVector<DominatorTree::UpdateType, 4> DTUpdates;
27662765
LLVM_DEBUG(dbgs() << "Turning " << *GI << " into a branch.\n");
27672766
BasicBlock *CheckBB = GI->getParent();
27682767

llvm/lib/Transforms/Utils/EscapeEnumerator.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ IRBuilder<> *EscapeEnumerator::Next() {
8787

8888
// Transform the 'call' instructions into 'invoke's branching to the
8989
// cleanup block. Go in reverse order to make prettier BB names.
90-
SmallVector<Value *, 16> Args;
9190
for (unsigned I = Calls.size(); I != 0;) {
9291
CallInst *CI = cast<CallInst>(Calls[--I]);
9392
changeToInvokeAndSplitBasicBlock(CI, CleanupBB, DTU);

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -7186,7 +7186,6 @@ void BoUpSLP::reorderTopToBottom() {
71867186
MapVector<OrdersType, unsigned,
71877187
DenseMap<OrdersType, unsigned, OrdersTypeDenseMapInfo>>
71887188
OrdersUses;
7189-
SmallPtrSet<const TreeEntry *, 4> VisitedOps;
71907189
for (const TreeEntry *OpTE : OrderedEntries) {
71917190
// No need to reorder this nodes, still need to extend and to use shuffle,
71927191
// just need to merge reordering shuffle and the reuse shuffle.
@@ -8153,7 +8152,6 @@ static void gatherPossiblyVectorizableLoads(
81538152
int &Offset, unsigned &Start) {
81548153
if (Loads.empty())
81558154
return GatheredLoads.end();
8156-
SmallVector<std::pair<int, int>> Res;
81578155
LoadInst *LI = Loads.front().first;
81588156
for (auto [Idx, Data] : enumerate(GatheredLoads)) {
81598157
if (Idx < Start)
@@ -13801,7 +13799,6 @@ bool BoUpSLP::isFullyVectorizableTinyTree(bool ForReduction) const {
1380113799
// with the second gather nodes if they have less scalar operands rather than
1380213800
// the initial tree element (may be profitable to shuffle the second gather)
1380313801
// or they are extractelements, which form shuffle.
13804-
SmallVector<int> Mask;
1380513802
if (VectorizableTree[0]->State == TreeEntry::Vectorize &&
1380613803
AreVectorizableGathers(VectorizableTree[1].get(),
1380713804
VectorizableTree[0]->Scalars.size()))
@@ -16875,8 +16872,6 @@ ResTy BoUpSLP::processBuildVector(const TreeEntry *E, Type *ScalarTy,
1687516872
unsigned VF = E->getVectorFactor();
1687616873

1687716874
bool NeedFreeze = false;
16878-
SmallVector<int> ReuseShuffleIndices(E->ReuseShuffleIndices.begin(),
16879-
E->ReuseShuffleIndices.end());
1688016875
SmallVector<Value *> GatheredScalars(E->Scalars.begin(), E->Scalars.end());
1688116876
// Clear values, to be replaced by insertvector instructions.
1688216877
for (auto [EIdx, Idx] : E->CombinedEntriesWithIndices)
@@ -17619,7 +17614,6 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
1761917614
SmallPtrSet<BasicBlock *, 4> VisitedBBs;
1762017615

1762117616
for (unsigned I : seq<unsigned>(PH->getNumIncomingValues())) {
17622-
ValueList Operands;
1762317617
BasicBlock *IBB = PH->getIncomingBlock(I);
1762417618

1762517619
// Stop emission if all incoming values are generated.
@@ -18291,7 +18285,6 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
1829118285
TysForDecl.push_back(VecTy);
1829218286
auto *CEI = cast<CallInst>(VL0);
1829318287
for (unsigned I : seq<unsigned>(0, CI->arg_size())) {
18294-
ValueList OpVL;
1829518288
// Some intrinsics have scalar arguments. This argument should not be
1829618289
// vectorized.
1829718290
if (UseIntrinsic && isVectorIntrinsicWithScalarOpAtArg(ID, I, TTI)) {

llvm/lib/Transforms/Vectorize/VPlan.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,6 @@ VPBasicBlock *VPBasicBlock::splitAt(iterator SplitAt) {
554554
assert((SplitAt == end() || SplitAt->getParent() == this) &&
555555
"can only split at a position in the same block");
556556

557-
SmallVector<VPBlockBase *, 2> Succs(successors());
558557
// Create new empty block after the block to split.
559558
auto *SplitBlock = getPlan()->createVPBasicBlock(getName() + ".split");
560559
VPBlockUtils::insertBlockAfter(SplitBlock, this);

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -1892,8 +1892,6 @@ static Value *getStepVector(Value *Val, Value *Step,
18921892
"Induction Step must be an integer or FP");
18931893
assert(Step->getType() == STy && "Step has wrong type");
18941894

1895-
SmallVector<Constant *, 8> Indices;
1896-
18971895
// Create a vector of consecutive numbers from zero to VF.
18981896
VectorType *InitVecValVTy = ValVTy;
18991897
if (STy->isFloatingPointTy()) {

0 commit comments

Comments
 (0)