[PATCH] D132571: [RLEV] Pick a correct insert point when incoming instruction is itself a phi node

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 29 11:33:34 PDT 2022


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LG



================
Comment at: llvm/lib/Transforms/Utils/LoopUtils.cpp:1400
+          (isa<PHINode>(Inst) || isa<LandingPadInst>(Inst)) ?
+          &*Inst->getParent()->getFirstInsertionPt() : Inst;
+        RewritePhiSet.emplace_back(PN, i, ExitValue, InsertPt, HighCost);
----------------
reames wrote:
> nikic wrote:
> > Any reason we don't just use `PN->getIncomingBlock(i)->getTerminator()` as the insertion point? That seems like a more obvious place to materialize an edge value.
> I'd been trying for a minimal fix.  Do you mind if we land this, and then do a follow up change as you suggest?  It'll cause significant test diffs which I think obscure the (rather narrow) impact of the fix.  
Sure


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132571/new/

https://reviews.llvm.org/D132571



More information about the llvm-commits mailing list