Skip to content

[Transforms] Remove unused local variables (NFC) #138442

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/lib/Transforms/IPO/FunctionImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,6 @@ class WorkloadImportsManager : public ModuleImportsManager {
GlobalsImporter GVI(Index, DefinedGVSummaries, IsPrevailing, ImportList,
ExportLists);
auto &ValueInfos = SetIter->second;
SmallVector<EdgeInfo, 128> GlobWorklist;
for (auto &VI : llvm::make_early_inc_range(ValueInfos)) {
auto It = DefinedGVSummaries.find(VI.getGUID());
if (It != DefinedGVSummaries.end() &&
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/IPO/IROutliner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2702,7 +2702,7 @@ void IROutliner::updateOutputMapping(OutlinableRegion &Region,
}

bool IROutliner::extractSection(OutlinableRegion &Region) {
SetVector<Value *> ArgInputs, Outputs, SinkCands;
SetVector<Value *> ArgInputs, Outputs;
assert(Region.StartBB && "StartBB for the OutlinableRegion is nullptr!");
BasicBlock *InitialStart = Region.StartBB;
Function *OrigF = Region.StartBB->getParent();
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Transforms/IPO/Internalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ bool InternalizePass::shouldPreserveGV(const GlobalValue &GV) {

bool InternalizePass::maybeInternalize(
GlobalValue &GV, DenseMap<const Comdat *, ComdatInfo> &ComdatMap) {
SmallString<0> ComdatName;
if (Comdat *C = GV.getComdat()) {
// For GlobalAlias, C is the aliasee object's comdat which may have been
// redirected. So ComdatMap may not contain C.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2040,8 +2040,6 @@ bool NumericalStabilitySanitizer::sanitizeFunction(
// the module constructor.
if (F.getName() == kNsanModuleCtorName)
return false;
SmallVector<Instruction *, 8> AllLoadsAndStores;
SmallVector<Instruction *, 8> LocalLoadsAndStores;

// The instrumentation maintains:
// - for each IR value `v` of floating-point (or vector floating-point) type
Expand Down
7 changes: 2 additions & 5 deletions llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2301,11 +2301,8 @@ FindPredecessorRetainWithSafePath(const Value *Arg, BasicBlock *BB,
/// Look for an ``autorelease'' instruction dependent on Arg such that there are
/// no instructions dependent on Arg that need a positive ref count in between
/// the autorelease and the ret.
static CallInst *
FindPredecessorAutoreleaseWithSafePath(const Value *Arg, BasicBlock *BB,
ReturnInst *Ret,
ProvenanceAnalysis &PA) {
SmallPtrSet<Instruction *, 4> DepInsts;
static CallInst *FindPredecessorAutoreleaseWithSafePath(
const Value *Arg, BasicBlock *BB, ReturnInst *Ret, ProvenanceAnalysis &PA) {
auto *Autorelease = dyn_cast_or_null<CallInst>(
findSingleDependency(NeedsPositiveRetainCount, Arg, BB, Ret, PA));

Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Transforms/Scalar/LoopInterchange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,6 @@ bool LoopInterchangeTransform::transform() {
BasicBlock *InnerLoopPreHeader = InnerLoop->getLoopPreheader();
BasicBlock *OuterLoopHeader = OuterLoop->getHeader();
if (InnerLoopPreHeader != OuterLoopHeader) {
SmallPtrSet<Instruction *, 4> NeedsMoving;
for (Instruction &I :
make_early_inc_range(make_range(InnerLoopPreHeader->begin(),
std::prev(InnerLoopPreHeader->end()))))
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Transforms/Scalar/NewGVN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2737,7 +2737,6 @@ NewGVN::makePossiblePHIOfOps(Instruction *I,
if (!isCycleFree(I))
return nullptr;

SmallPtrSet<const Value *, 8> ProcessedPHIs;
// TODO: We don't do phi translation on memory accesses because it's
// complicated. For a load, we'd need to be able to simulate a new memoryuse,
// which we don't have a good way of doing ATM.
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2762,7 +2762,6 @@ static BranchInst *turnSelectIntoBranch(SelectInst *SI, DominatorTree &DT,
static BranchInst *turnGuardIntoBranch(IntrinsicInst *GI, Loop &L,
DominatorTree &DT, LoopInfo &LI,
MemorySSAUpdater *MSSAU) {
SmallVector<DominatorTree::UpdateType, 4> DTUpdates;
LLVM_DEBUG(dbgs() << "Turning " << *GI << " into a branch.\n");
BasicBlock *CheckBB = GI->getParent();

Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Transforms/Utils/EscapeEnumerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ IRBuilder<> *EscapeEnumerator::Next() {

// Transform the 'call' instructions into 'invoke's branching to the
// cleanup block. Go in reverse order to make prettier BB names.
SmallVector<Value *, 16> Args;
for (unsigned I = Calls.size(); I != 0;) {
CallInst *CI = cast<CallInst>(Calls[--I]);
changeToInvokeAndSplitBasicBlock(CI, CleanupBB, DTU);
Expand Down
7 changes: 0 additions & 7 deletions llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7186,7 +7186,6 @@ void BoUpSLP::reorderTopToBottom() {
MapVector<OrdersType, unsigned,
DenseMap<OrdersType, unsigned, OrdersTypeDenseMapInfo>>
OrdersUses;
SmallPtrSet<const TreeEntry *, 4> VisitedOps;
for (const TreeEntry *OpTE : OrderedEntries) {
// No need to reorder this nodes, still need to extend and to use shuffle,
// just need to merge reordering shuffle and the reuse shuffle.
Expand Down Expand Up @@ -8153,7 +8152,6 @@ static void gatherPossiblyVectorizableLoads(
int &Offset, unsigned &Start) {
if (Loads.empty())
return GatheredLoads.end();
SmallVector<std::pair<int, int>> Res;
LoadInst *LI = Loads.front().first;
for (auto [Idx, Data] : enumerate(GatheredLoads)) {
if (Idx < Start)
Expand Down Expand Up @@ -13801,7 +13799,6 @@ bool BoUpSLP::isFullyVectorizableTinyTree(bool ForReduction) const {
// with the second gather nodes if they have less scalar operands rather than
// the initial tree element (may be profitable to shuffle the second gather)
// or they are extractelements, which form shuffle.
SmallVector<int> Mask;
if (VectorizableTree[0]->State == TreeEntry::Vectorize &&
AreVectorizableGathers(VectorizableTree[1].get(),
VectorizableTree[0]->Scalars.size()))
Expand Down Expand Up @@ -16875,8 +16872,6 @@ ResTy BoUpSLP::processBuildVector(const TreeEntry *E, Type *ScalarTy,
unsigned VF = E->getVectorFactor();

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

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

// Stop emission if all incoming values are generated.
Expand Down Expand Up @@ -18291,7 +18285,6 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
TysForDecl.push_back(VecTy);
auto *CEI = cast<CallInst>(VL0);
for (unsigned I : seq<unsigned>(0, CI->arg_size())) {
ValueList OpVL;
// Some intrinsics have scalar arguments. This argument should not be
// vectorized.
if (UseIntrinsic && isVectorIntrinsicWithScalarOpAtArg(ID, I, TTI)) {
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Transforms/Vectorize/VPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ VPBasicBlock *VPBasicBlock::splitAt(iterator SplitAt) {
assert((SplitAt == end() || SplitAt->getParent() == this) &&
"can only split at a position in the same block");

SmallVector<VPBlockBase *, 2> Succs(successors());
// Create new empty block after the block to split.
auto *SplitBlock = getPlan()->createVPBasicBlock(getName() + ".split");
VPBlockUtils::insertBlockAfter(SplitBlock, this);
Expand Down
2 changes: 0 additions & 2 deletions llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1892,8 +1892,6 @@ static Value *getStepVector(Value *Val, Value *Step,
"Induction Step must be an integer or FP");
assert(Step->getType() == STy && "Step has wrong type");

SmallVector<Constant *, 8> Indices;

// Create a vector of consecutive numbers from zero to VF.
VectorType *InitVecValVTy = ValVTy;
if (STy->isFloatingPointTy()) {
Expand Down
Loading