Skip to content

Commit 304a990

Browse files
committed
[NFC][DebugInfo] Use iterators for insertion at some final callsites
These are the callsites that have materialised in the last three weeks since I last built with deprecation warnings.
1 parent 7f845cb commit 304a990

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

llvm/examples/IRTransforms/SimplifyCFG.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static bool mergeIntoSinglePredecessor_v1(Function &F) {
286286
}
287287
// Move all instructions from BB to Pred.
288288
for (Instruction &I : make_early_inc_range(BB))
289-
I.moveBefore(Pred->getTerminator());
289+
I.moveBefore(Pred->getTerminator()->getIterator());
290290

291291
// Remove the Pred's terminator (which jumped to BB). BB's terminator
292292
// will become Pred's terminator.
@@ -337,7 +337,7 @@ static bool mergeIntoSinglePredecessor_v2(Function &F, DominatorTree &DT) {
337337
}
338338
// Move all instructions from BB to Pred.
339339
for (Instruction &I : make_early_inc_range(BB))
340-
I.moveBefore(Pred->getTerminator());
340+
I.moveBefore(Pred->getTerminator()->getIterator());
341341

342342
// Remove the Pred's terminator (which jumped to BB). BB's terminator
343343
// will become Pred's terminator.

llvm/lib/Analysis/Loads.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ bool llvm::isDereferenceableAndAlignedInLoop(
361361
} else
362362
return false;
363363

364-
Instruction *HeaderFirstNonPHI = L->getHeader()->getFirstNonPHI();
364+
Instruction *HeaderFirstNonPHI = &*L->getHeader()->getFirstNonPHIIt();
365365
return isDereferenceableAndAlignedPointer(Base, Alignment, AccessSize, DL,
366366
HeaderFirstNonPHI, AC, &DT);
367367
}

llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void SPIRVRegularizer::runLowerConstExpr(Function &F) {
8383
LLVM_DEBUG(dbgs() << "[lowerConstantExpressions] " << *CE);
8484
auto ReplInst = CE->getAsInstruction();
8585
auto InsPoint = II->getParent() == &*FBegin ? II : &FBegin->back();
86-
ReplInst->insertBefore(InsPoint);
86+
ReplInst->insertBefore(InsPoint->getIterator());
8787
LLVM_DEBUG(dbgs() << " -> " << *ReplInst << '\n');
8888
std::vector<Instruction *> Users;
8989
// Do not replace use during iteration of use. Do it in another loop.
@@ -97,7 +97,7 @@ void SPIRVRegularizer::runLowerConstExpr(Function &F) {
9797
for (auto &User : Users) {
9898
if (ReplInst->getParent() == User->getParent() &&
9999
User->comesBefore(ReplInst))
100-
ReplInst->moveBefore(User);
100+
ReplInst->moveBefore(User->getIterator());
101101
User->replaceUsesOfWith(CE, ReplInst);
102102
}
103103
return ReplInst;

llvm/lib/Target/SPIRV/SPIRVStructurizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ class SPIRVStructurizer : public FunctionPass {
683683
});
684684

685685
for (Instruction *I : MergeInstructions) {
686-
I->moveBefore(InsertionPoint);
686+
I->moveBefore(InsertionPoint->getIterator());
687687
InsertionPoint = I;
688688
}
689689

llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2044,7 +2044,7 @@ convertFSqrtDivIntoFMul(CallInst *CI, Instruction *X,
20442044
// instructions in R2 and get the most common fpmath metadata and fast-math
20452045
// flags on it.
20462046
auto *FSqrt = cast<CallInst>(CI->clone());
2047-
FSqrt->insertBefore(CI);
2047+
FSqrt->insertBefore(CI->getIterator());
20482048
auto *R2FPMathMDNode = (*R2.begin())->getMetadata(LLVMContext::MD_fpmath);
20492049
FastMathFlags R2FMF = (*R2.begin())->getFastMathFlags(); // Common FMF
20502050
for (Instruction *I : R2) {

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10301,8 +10301,8 @@ preparePlanForEpilogueVectorLoop(VPlan &Plan, Loop *L,
1030110301
// value. This ensures correctness when the start value might not be
1030210302
// less than the minimum value of a monotonically increasing induction
1030310303
// variable.
10304-
IRBuilder<> Builder(
10305-
cast<Instruction>(ResumeV)->getParent()->getFirstNonPHI());
10304+
BasicBlock *ResumeBB = cast<Instruction>(ResumeV)->getParent();
10305+
IRBuilder<> Builder(ResumeBB, ResumeBB->getFirstNonPHIIt());
1030610306
Value *Cmp =
1030710307
Builder.CreateICmpEQ(ResumeV, RdxDesc.getRecurrenceStartValue());
1030810308
ResumeV =

0 commit comments

Comments
 (0)