aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/IndVarSimplify/eliminate-comparison.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-04-19 21:48:58 +0000
committerDan Gohman <gohman@apple.com>2010-04-19 21:48:58 +0000
commitc056454ecfe66f7c646fedef594f4ed48a9f3bf0 (patch)
tree28e6d0cdf9d74993b1ee12acf2f1a032d0b8eb17 /test/Transforms/IndVarSimplify/eliminate-comparison.ll
parent22e401f5d4d863e753bc8e5655bac481602d22e6 (diff)
downloadexternal_llvm-c056454ecfe66f7c646fedef594f4ed48a9f3bf0.zip
external_llvm-c056454ecfe66f7c646fedef594f4ed48a9f3bf0.tar.gz
external_llvm-c056454ecfe66f7c646fedef594f4ed48a9f3bf0.tar.bz2
Remove the Expr member from IVUsers. Instead of remembering the expression,
just ask ScalarEvolution for it on demand. This helps IVUsers be more robust in the case of expressions changing underneath it. This fixes PR6862. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101819 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/IndVarSimplify/eliminate-comparison.ll')
-rw-r--r--test/Transforms/IndVarSimplify/eliminate-comparison.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/Transforms/IndVarSimplify/eliminate-comparison.ll b/test/Transforms/IndVarSimplify/eliminate-comparison.ll
index 9346649..953bbdf 100644
--- a/test/Transforms/IndVarSimplify/eliminate-comparison.ll
+++ b/test/Transforms/IndVarSimplify/eliminate-comparison.ll
@@ -82,3 +82,27 @@ bb20.loopexit:
%tmp.0.ph = phi i32 [ 0, %bb18 ], [ 1, %bb15 ], [ 0, %bb13 ]
ret i32 %tmp.0.ph
}
+
+; Indvars should eliminate the icmp here.
+
+; CHECK: @func_10
+; CHECK-NOT: icmp
+; CHECK: ret void
+
+define void @func_10() nounwind {
+entry:
+ br label %loop
+
+loop:
+ %i = phi i32 [ %i.next, %loop ], [ 0, %entry ]
+ %t0 = icmp slt i32 %i, 0
+ %t1 = zext i1 %t0 to i32
+ %t2 = add i32 %t1, %i
+ %u3 = zext i32 %t2 to i64
+ store i64 %u3, i64* null
+ %i.next = add i32 %i, 1
+ br i1 undef, label %loop, label %return
+
+return:
+ ret void
+}