[PATCH] D152537: [NFC][DebugInfo][RemoveDIs] Prefer insert-with-iterator over instruction pointers when inserting into blocks
Orlando Cazalet-Hyams via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 8 01:40:30 PDT 2023
Orlando accepted this revision.
Orlando added a comment.
This revision is now accepted and ready to land.
Herald added a subscriber: wangpc.
There are a load of `getFirstNonPHI()` -> `getFirstInsertionPt()` that I think should be `getFirstNonPHI()` -> `getFirstNonPHIIt()` (marked inlined) based on the discussion in D152468 <https://reviews.llvm.org/D152468>, otherwise LGTM.
================
Comment at: llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp:711
+ getInstrName(BaseMemI, PHINodeNameSuffix));
+ NewPHI->insertBefore(Header->getFirstInsertionPt());
----------------
================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:2194
+ ReplPHI = PHINode::Create(LandingPad->getType(), 1, "");
+ ReplPHI->insertBefore(BB.getFirstInsertionPt());
ReplPHI->takeName(LandingPad);
----------------
================
Comment at: llvm/lib/Transforms/IPO/PartialInlining.cpp:1055
OldPhi->replaceAllUsesWith(RetPhi);
- Ins = ClonedOI->ReturnBlock->getFirstNonPHI();
+ Ins = ClonedOI->ReturnBlock->getFirstInsertionPt();
----------------
================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:2154-2155
Builder.SetInsertPoint(LbCond);
- Instruction *TcDec = cast<Instruction>(
- Builder.CreateSub(TcPhi, ConstantInt::get(Ty, 1),
- "tcdec", false, true));
+ Instruction *TcDec = cast<Instruction>(Builder.CreateSub(
+ TcPhi, ConstantInt::get(Ty, 1), "tcdec", false, true));
----------------
nit: Looks like this bit has just been reformatted? Possibly should be left unchanged, but not a strong opinion.
================
Comment at: llvm/lib/Transforms/Utils/CodeExtractor.cpp:781
+ PN.getName() + ".ce");
+ NewPN->insertBefore(NewBB->getFirstInsertionPt());
for (unsigned i : IncomingVals)
----------------
================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:109
+ PHINode *NewPN = PHINode::Create(PN.getType(), 2, PN.getName() + ".unr");
+ NewPN->insertBefore(PrologExit->getFirstInsertionPt());
// Adding a value to the new PHI node from the original loop preheader.
----------------
================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:273
+ PHINode *NewPN = PHINode::Create(PN.getType(), 2, PN.getName() + ".unr");
+ NewPN->insertBefore(NewExit->getFirstInsertionPt());
// Adding a value to the new PHI node from the unrolling loop preheader.
----------------
================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:368
+ PHINode::Create(NewIter->getType(), 2, suffix + ".iter");
+ NewIdx->insertBefore(FirstLoopBB->getFirstInsertionPt());
auto *Zero = ConstantInt::get(NewIdx->getType(), 0);
----------------
================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:917
+ PHINode *NewIdx = PHINode::Create(TestVal->getType(), 2, "niter");
+ NewIdx->insertBefore(Header->getFirstInsertionPt());
B2.SetInsertPoint(LatchBR);
----------------
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8045
+ PHINode *EPResumeVal = PHINode::Create(IdxTy, 2, "vec.epilog.resume.val");
+ EPResumeVal->insertBefore(LoopVectorPreHeader->getFirstInsertionPt());
EPResumeVal->addIncoming(EPI.VectorTripCount, VecEpilogueIterationCountCheck);
----------------
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152537/new/
https://reviews.llvm.org/D152537
More information about the llvm-commits
mailing list