[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 15:11:02 PDT 2018
vsk added a comment.
In https://reviews.llvm.org/D47874#1126902, @fhahn wrote:
> Or maybe it would be even more convenient to just have a new iterator type, which skips such meta instructions.
Presumably there's a lot of pre-existing code which traffics in BasicBlock::iterator. It might be hard to refactor that code to use a different iterator kind.
> Something straight forward would be to just add something like the skipDebug below as a static function to BasicBlock
My preference is to have a function in the llvm namespace which advances a BasicBlock::iterator, because I don't think of a BasicBlock as something that can advance an iterator.
>> Yeah, maybe we should have a function that takes an iterator and advances the iterator to the first non debug/meta instruction?
>
> I think so, we could also refactor https://reviews.llvm.org/rL334317 to be less cumbersome.
> Are you going to work on this or you want me to? [I suspect we're going to find more places where we need the utility so the sooner we get this done, the better].
I'm going on a week-long vacation starting tomorrow, so I'm happy to have someone else push this forward :).
Skimming through the LangRef, here are the intrinsics which should be non-affecting: llvm.donothing, llvm.dbg.*, and llvm.{var, ptr, }.annotation.*. I'm skeptical of adding lifetime markers and llvm.assume to this list, because these intrinsics have behaviors that optimizations may want to consider.
https://reviews.llvm.org/D47874
More information about the llvm-commits
mailing list