diff options
author | Andrew Trick <atrick@apple.com> | 2014-01-15 06:42:11 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2014-01-15 06:42:11 +0000 |
commit | ee5aa7f71a31464add40eee358fd5720372d64c6 (patch) | |
tree | 7c698b6abe383e18290d09cd000b37b4c62555ff /llvm/test/Transforms/IndVarSimplify/tripcount_compute.ll | |
parent | b9737cd0bcac6e5ed65c169e595834a20bf6297d (diff) | |
download | bcm5719-llvm-ee5aa7f71a31464add40eee358fd5720372d64c6.tar.gz bcm5719-llvm-ee5aa7f71a31464add40eee358fd5720372d64c6.zip |
Fix PR18449: SCEV needs more precise max BECount for multi-exit loop.
llvm-svn: 199299
Diffstat (limited to 'llvm/test/Transforms/IndVarSimplify/tripcount_compute.ll')
-rw-r--r-- | llvm/test/Transforms/IndVarSimplify/tripcount_compute.ll | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/Transforms/IndVarSimplify/tripcount_compute.ll b/llvm/test/Transforms/IndVarSimplify/tripcount_compute.ll index 626a29b20b7..966d152cda6 100644 --- a/llvm/test/Transforms/IndVarSimplify/tripcount_compute.ll +++ b/llvm/test/Transforms/IndVarSimplify/tripcount_compute.ll @@ -160,3 +160,34 @@ loop9: ; preds = %loop2, %loopexit loopexit9: ; preds = %loop2 ret i32 %l.next } + +; PR18449. Check that the early exit is reduced to never taken. +; +; CHECK-LABEL: @twoexit +; CHECK-LABEL: loop: +; CHECK: phi +; CHECK: br i1 false +; CHECK: br +; CHECK: ret +define void @twoexit() { +"function top level": + br label %loop + +loop: ; preds = %body, %"function top level" + %0 = phi i64 [ 0, %"function top level" ], [ %2, %body ] + %1 = icmp ugt i64 %0, 2 + br i1 %1, label %fail, label %body + +fail: ; preds = %loop + tail call void @bounds_fail() + unreachable + +body: ; preds = %loop + %2 = add i64 %0, 1 + %3 = icmp slt i64 %2, 3 + br i1 %3, label %loop, label %out + +out: ; preds = %body + ret void +} +declare void @bounds_fail() |