summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/IndVarSimplify/lftr-extend-const.ll
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-09-03 23:03:18 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-09-03 23:03:18 +0000
commitc6ab01eccae05aee4bae81a875a6eb88907247c5 (patch)
treebd4c16b8d55d58e1697cf55275b6c8d167790348 /llvm/test/Transforms/IndVarSimplify/lftr-extend-const.ll
parentfb5d6852c6038455dca4da196558803005ced0d1 (diff)
downloadbcm5719-llvm-c6ab01eccae05aee4bae81a875a6eb88907247c5.tar.gz
bcm5719-llvm-c6ab01eccae05aee4bae81a875a6eb88907247c5.zip
IndVarSimplify: Don't let LFTR compare against a poison value
LinearFunctionTestReplace tries to use the *next* indvar to compare against when possible. However, it may be the case that the calculation for the next indvar has NUW/NSW flags and that it may only be safely used inside the loop. Using it in a comparison to calculate the exit condition could result in observing poison. This fixes PR20680. Differential Revision: http://reviews.llvm.org/D5174 llvm-svn: 217102
Diffstat (limited to 'llvm/test/Transforms/IndVarSimplify/lftr-extend-const.ll')
-rw-r--r--llvm/test/Transforms/IndVarSimplify/lftr-extend-const.ll4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/Transforms/IndVarSimplify/lftr-extend-const.ll b/llvm/test/Transforms/IndVarSimplify/lftr-extend-const.ll
index 4736f857bcc..eeffd0f5502 100644
--- a/llvm/test/Transforms/IndVarSimplify/lftr-extend-const.ll
+++ b/llvm/test/Transforms/IndVarSimplify/lftr-extend-const.ll
@@ -2,7 +2,7 @@
; CHECK-LABEL: @foo(
; CHECK-NOT: %lftr.wideiv = trunc i32 %indvars.iv.next to i16
-; CHECK: %exitcond = icmp ne i32 %indvars.iv.next, 512
+; CHECK: %exitcond = icmp ne i32 %indvars.iv, 511
define void @foo() #0 {
entry:
br label %for.body
@@ -21,7 +21,7 @@ for.end: ; preds = %for.body
; Check that post-incrementing the backedge taken count does not overflow.
; CHECK-LABEL: @postinc(
-; CHECK: icmp eq i32 %indvars.iv.next, 256
+; CHECK: icmp eq i32 %indvars.iv, 255
define i32 @postinc() #0 {
entry:
br label %do.body
OpenPOWER on IntegriCloud