[PATCH] D49746: [WIP][LV][DebugInfo] Set DL to the middle block Icmp instruction

Anastasis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 25 06:41:00 PDT 2018


gramanas added a comment.

In https://reviews.llvm.org/D49746#1174388, @hsaito wrote:

> This is essentially a zero trip check for the remainder loop and from that perspective, the most correct DL we should use would be the one related to trip count computation. InnerLoopVectorizer::getOrCreateTripCount() is where LV computes the trip count of the incoming scalar loop. It uses getBackedgeTakeCount(). As such, strictly speaking, taking the DL from the predicate (i.e., loop bottom test) fed to the loop backedge would make most sense. That would be OrigLoop->getLoopLatch()->getTerminator() to get to the backedge. In a relaxed thinking, however, this is the code executed when we know vector code executes. So, taking DL from VectorPH code isn't too bad. OrigLoop->getStartLoc() could be another viable enough alternative.
>
> Does this make sense to you? Which one would you pick?


Thank you for the comment.

I don't understand what zero trip means but I think the second case, `OrigLoop->getStartLoc()`, fits a bit better. I assigned the `VectorPH->getTerminator()` DL to get the same result basically.  Your explanation along with a google search explained a lot and it makes more sense now to have this DL since it's the condition for a jump to the other part of the loop.


Repository:
  rL LLVM

https://reviews.llvm.org/D49746





More information about the llvm-commits mailing list