[PATCH] D39500: [LoopPredication] Enable predication when latchCheckIV is wider than rangeCheck

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 1 12:03:34 PDT 2017


anna created this revision.

This patch allows us to predicate range checks that have a type narrower than
the latch check type. We leverage SCEV analysis to identify a truncate for the
latchLimit and latchStart.
There is also safety checks in place which requires the start and limit to be
known at compile time. We require this to make sure that the SCEV truncate expr
for the IV corresponding to the latch does not cause us to lose information
about the IV range.
Added tests show the loop predication over range checks that are of various
types and are narrower than the latch type.
This enhancement has been in our downstream tree for a while.


https://reviews.llvm.org/D39500

Files:
  lib/Transforms/Scalar/LoopPredication.cpp
  test/Transforms/LoopPredication/widened.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39500.121161.patch
Type: text/x-patch
Size: 13148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171101/869178db/attachment.bin>


More information about the llvm-commits mailing list