OSDN Git Service

[LoopPredication] Enable predication when latchCheckIV is wider than rangeCheck
authorAnna Thomas <anna@azul.com>
Thu, 2 Nov 2017 21:21:02 +0000 (21:21 +0000)
committerAnna Thomas <anna@azul.com>
Thu, 2 Nov 2017 21:21:02 +0000 (21:21 +0000)
commitb69a2a9ae35ca7d19399c8d23287f10a8bdf0f45
tree6174799dff14ad09b1e8ee4359ed10ee69b7447b
parent2e63034efd79807891a4d201daeb434c2d26c609
[LoopPredication] Enable predication when latchCheckIV is wider than rangeCheck

Summary:
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.

Reviewers: apilipenko, sanjoy, mkazantsev

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D39500

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317269 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopPredication.cpp
test/Transforms/LoopPredication/widened.ll [new file with mode: 0644]