summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopPredication/visited.ll
diff options
context:
space:
mode:
authorArtur Pilipenko <apilipenko@azulsystems.com>2017-09-22 13:13:57 +0000
committerArtur Pilipenko <apilipenko@azulsystems.com>2017-09-22 13:13:57 +0000
commit889dc1e3a58cb9c2e38d49138f6e338242315de3 (patch)
treec556411a1f4880e56c775e087646fff01ab70edd /llvm/test/Transforms/LoopPredication/visited.ll
parentcea42b7fff23a7637a641cb62666ca0756b9b81d (diff)
downloadbcm5719-llvm-889dc1e3a58cb9c2e38d49138f6e338242315de3.tar.gz
bcm5719-llvm-889dc1e3a58cb9c2e38d49138f6e338242315de3.zip
Rework loop predication pass
We've found a serious issue with the current implementation of loop predication. The current implementation relies on SCEV and this turned out to be problematic. To fix the problem we had to rework the pass substantially. We have had the reworked implementation in our downstream tree for a while. This is the initial patch of the series of changes to upstream the new implementation. For now the transformation is limited to the following case: * The loop has a single latch with either ult or slt icmp condition. * The step of the IV used in the latch condition is 1. * The IV of the latch condition is the same as the post increment IV of the guard condition. * The guard condition is ult. See the review or the LoopPredication.cpp header for the details about the problem and the new implementation. Reviewed By: sanjoy, mkazantsev Differential Revision: https://reviews.llvm.org/D37569 llvm-svn: 313981
Diffstat (limited to 'llvm/test/Transforms/LoopPredication/visited.ll')
-rw-r--r--llvm/test/Transforms/LoopPredication/visited.ll5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/test/Transforms/LoopPredication/visited.ll b/llvm/test/Transforms/LoopPredication/visited.ll
index e9aae77f8e6..01feaeabd16 100644
--- a/llvm/test/Transforms/LoopPredication/visited.ll
+++ b/llvm/test/Transforms/LoopPredication/visited.ll
@@ -11,8 +11,9 @@ entry:
loop.preheader:
; CHECK: loop.preheader:
-; CHECK: [[iteration_count:[^ ]+]] = add i32 %n, -1
-; CHECK-NEXT: [[wide_cond:[^ ]+]] = icmp ult i32 [[iteration_count]], %length
+; CHECK: [[first_iteration_check:[^ ]+]] = icmp ult i32 0, %length
+; CHECK-NEXT: [[limit_check:[^ ]+]] = icmp ule i32 %n, %length
+; CHECK-NEXT: [[wide_cond:[^ ]+]] = and i1 [[first_iteration_check]], [[limit_check]]
; CHECK-NEXT: br label %loop
br label %loop
OpenPOWER on IntegriCloud