[PATCH] D28460: getLoopEstimatedTripCount should really be called getLoopEstimatedBackedgeTakeCount.

Michael Kuperstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 11:05:02 PST 2017


mkuper added a comment.

> In case the loop is bottom tested (rotated), there would be an off-by-1, as the loop body is executed backedge-count + 1 times.
>  If its not bottom tested, we would not have this profile data on the latch, right ? I would assume the latch simply branches back to the header and the test is in the header.

Hm, yes, that sounds right.

I'm still not sure why we get seemingly correct results with the current code, though. :-)
One option is that we don't. But if we do - maybe we don't update profile metadata correctly in loop rotation?


https://reviews.llvm.org/D28460





More information about the llvm-commits mailing list