[PATCH] D47874: [SCEVExpander] Ignore dbg info when finding insertion point.

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 8 13:15:43 PDT 2018


vsk added a comment.

In https://reviews.llvm.org/D47874#1125517, @fhahn wrote:

> In https://reviews.llvm.org/D47874#1125474, @efriedma wrote:
>
> > Not sure this is the best fix.  The function is named findInsertPointAfter; from the name, I would expect it to behave similarly to BasicBlock::getFirstInsertionPt (which does not try to move past debug info).
> >
> > We added instructionsWithoutDebug recently to deal with this sort of issue, but it's not directly usable here.
>
>
> Yeah, maybe we should have a function that takes an iterator and advances the iterator to the first non debug/meta instruction?


Yes, I think it makes sense to introduce this. It might also be convenient to add an analogous method to Instruction to replace some uses of getNextNode().



================
Comment at: lib/Analysis/ScalarEvolutionExpander.cpp:95
 
-  while (isa<PHINode>(IP))
+  while (isa<PHINode>(IP) || isa<DbgInfoIntrinsic>(IP))
     ++IP;
----------------
efriedma wrote:
> This handling isn't consistent with the handling for landing pads/etc.
Would it be correct to write "IP = advancePastNonAffectingInsts(IP)", everywhere we see "++IP" here?


https://reviews.llvm.org/D47874





More information about the llvm-commits mailing list