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

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 08:03:49 PDT 2022


reames added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LoopUtils.cpp:1398-1400
+        Instruction *InsertPt =
+          (isa<PHINode>(Inst) || isa<LandingPadInst>(Inst)) ?
+          &*Inst->getParent()->getFirstInsertionPt() : Inst;
----------------
yrouban wrote:
> Would it be better to fix //SCEVExpander::expandCodeForImpl(const SCEV *SH, Type *Ty, Instruction *IP, bool Root)// so it fixed IP in the same way? It would fix all its users.
No.  any routine given an insertion point should use it.  It might make sense to add an *assert* that the insertion point is sane, but mutating the insertion point explicitly would be quite confusing.  


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132571



More information about the llvm-commits mailing list