diff options
author | Dan Gohman <gohman@apple.com> | 2010-04-19 21:48:58 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-04-19 21:48:58 +0000 |
commit | 72e3bd3bfef59d04e61e3f2538df51e95ebbb759 (patch) | |
tree | 28e6d0cdf9d74993b1ee12acf2f1a032d0b8eb17 /test | |
parent | b0573281ad2b6d815f6dd2e7048afa50f5863dd6 (diff) | |
download | external_llvm-72e3bd3bfef59d04e61e3f2538df51e95ebbb759.zip external_llvm-72e3bd3bfef59d04e61e3f2538df51e95ebbb759.tar.gz external_llvm-72e3bd3bfef59d04e61e3f2538df51e95ebbb759.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')
-rw-r--r-- | test/Transforms/IndVarSimplify/eliminate-comparison.ll | 24 |
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 +} |