diff options
author | Dinesh Dwivedi <dinesh.d@samsung.com> | 2014-05-27 06:44:25 +0000 |
---|---|---|
committer | Dinesh Dwivedi <dinesh.d@samsung.com> | 2014-05-27 06:44:25 +0000 |
commit | f31b009b3e3af261cbf6ec8f65337187414797f5 (patch) | |
tree | beb76b587dc91a1f1362a83106477f4279fee479 /test/Analysis | |
parent | c5f611404c4eecf5006e7bb72b69d6da029e382a (diff) | |
download | llvm-f31b009b3e3af261cbf6ec8f65337187414797f5.tar.gz llvm-f31b009b3e3af261cbf6ec8f65337187414797f5.tar.bz2 llvm-f31b009b3e3af261cbf6ec8f65337187414797f5.tar.xz |
Adding testcase for PR18886.
Differential Revision: http://reviews.llvm.org/D3837
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209645 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r-- | test/Analysis/ScalarEvolution/max-trip-count.ll | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Analysis/ScalarEvolution/max-trip-count.ll b/test/Analysis/ScalarEvolution/max-trip-count.ll index 75f7418f14..31f06a46ad 100644 --- a/test/Analysis/ScalarEvolution/max-trip-count.ll +++ b/test/Analysis/ScalarEvolution/max-trip-count.ll @@ -125,6 +125,33 @@ bar.exit: ; preds = %for.cond.i, %for.bo ret i32 0 } +; PR18886: Indvars miscompile due to an incorrect max backedge taken count from SCEV. +; CHECK-LABEL: @pr18886 +; CHECK: Loop %for.body: <multiple exits> Unpredictable backedge-taken count. +; CHECK: Loop %for.body: max backedge-taken count is 3 +@aa = global i64 0, align 8 + +define i32 @pr18886() { +entry: + store i64 -21, i64* @aa, align 8 + br label %for.body + +for.body: + %storemerge1 = phi i64 [ -21, %entry ], [ %add, %for.cond ] + %tobool = icmp eq i64 %storemerge1, 0 + %add = add nsw i64 %storemerge1, 8 + br i1 %tobool, label %return, label %for.cond + +for.cond: + store i64 %add, i64* @aa, align 8 + %cmp = icmp slt i64 %add, 9 + br i1 %cmp, label %for.body, label %return + +return: + %retval.0 = phi i32 [ 1, %for.body ], [ 0, %for.cond ] + ret i32 %retval.0 +} + ; Here we have a must-exit loop latch that is not computable and a ; may-exit early exit that can only have one non-exiting iteration ; before the check is forever skipped. |