[PATCH] D102615: [LoopDeletion] Break backedge if we can prove that the loop is exited on 1st iteration

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 17 20:44:19 PDT 2021


mkazantsev added a comment.

In D102615#2764466 <https://reviews.llvm.org/D102615#2764466>, @reames wrote:

> I'm confused why this is worthwhile.  LoopUnrolling already knows how to symbolically execute a loop.  Shouldn't LoopUnroll fully unroll this loop by one - thus deleting the loop backedge in question?

Full unrolling is only possible when we know trip count, which is not the case here. There is a subtle difference between computing the trip count and proving that the trip count is zero. This patch is trying to make the latter in cases when it's not known.


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

https://reviews.llvm.org/D102615



More information about the llvm-commits mailing list