summaryrefslogtreecommitdiff
path: root/test/Transforms/LoopUnroll
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-09-02 21:21:03 +0000
committerAndrew Trick <atrick@apple.com>2011-09-02 21:21:03 +0000
commit6984625d166791f9d100e47f0e834c8c6a56169b (patch)
tree9987b4bc44ad72fb33773aa956d6df19d10ced8e /test/Transforms/LoopUnroll
parent252ef7a61a9455c1e5d7b8a5a5f7ec8b3a75e200 (diff)
downloadllvm-6984625d166791f9d100e47f0e834c8c6a56169b.tar.gz
llvm-6984625d166791f9d100e47f0e834c8c6a56169b.tar.bz2
llvm-6984625d166791f9d100e47f0e834c8c6a56169b.tar.xz
Test case update for unroll-scev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139037 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopUnroll')
-rw-r--r--test/Transforms/LoopUnroll/2011-08-08-PhiUpdate.ll11
-rw-r--r--test/Transforms/LoopUnroll/2011-08-09-IVSimplify.ll10
2 files changed, 13 insertions, 8 deletions
diff --git a/test/Transforms/LoopUnroll/2011-08-08-PhiUpdate.ll b/test/Transforms/LoopUnroll/2011-08-08-PhiUpdate.ll
index dce4c09451..cd954c80ec 100644
--- a/test/Transforms/LoopUnroll/2011-08-08-PhiUpdate.ll
+++ b/test/Transforms/LoopUnroll/2011-08-08-PhiUpdate.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -loop-unroll -S -unroll-count=4 -disable-unroll-scev | FileCheck %s
+; RUN: opt < %s -loop-unroll -S -unroll-count=4 | FileCheck %s
; Test phi update after partial unroll.
declare i1 @check() nounwind
@@ -73,13 +73,15 @@ bb2: ; preds = %bb1.bb2_crit_edge,
; CHECK: exit.3:
define i32 @test3() nounwind uwtable ssp align 2 {
entry:
- br i1 undef, label %return, label %if.end
+ %cond1 = call zeroext i1 @check()
+ br i1 %cond1, label %return, label %if.end
if.end: ; preds = %entry
br label %do.body
do.body: ; preds = %do.cond, %if.end
- br i1 undef, label %exit, label %do.cond
+ %cond2 = call zeroext i1 @check()
+ br i1 %cond2, label %exit, label %do.cond
exit: ; preds = %do.body
%tmp7.i = load i32* undef, align 8
@@ -89,7 +91,8 @@ land.lhs.true: ; preds = %exit
br i1 undef, label %return, label %do.cond
do.cond: ; preds = %land.lhs.true, %exit, %do.body
- br i1 undef, label %do.end, label %do.body
+ %cond3 = call zeroext i1 @check()
+ br i1 %cond3, label %do.end, label %do.body
do.end: ; preds = %do.cond
br label %return
diff --git a/test/Transforms/LoopUnroll/2011-08-09-IVSimplify.ll b/test/Transforms/LoopUnroll/2011-08-09-IVSimplify.ll
index 34814e1abd..4a5cbf9672 100644
--- a/test/Transforms/LoopUnroll/2011-08-09-IVSimplify.ll
+++ b/test/Transforms/LoopUnroll/2011-08-09-IVSimplify.ll
@@ -1,18 +1,20 @@
-; RUN: opt -S < %s -loop-unroll -unroll-count=4 -disable-iv-rewrite -disable-unroll-scev | FileCheck %s
+; RUN: opt -S < %s -loop-unroll -unroll-count=4 -disable-iv-rewrite | FileCheck %s
;
; Test induction variable simplify after loop unrolling. It should
; expose nice opportunities for GVN.
+;
+; CHECK-NOT: while.body also ensures that loop unrolling (with SCEV)
+; removes unrolled loop exits given that 128 is a multiple of 4.
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:128:128-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
; PR10534: LoopUnroll not keeping canonical induction variable...
-; CHECK: while.body.1:
+; CHECK: while.body:
+; CHECK-NOT: while.body.1:
; CHECK: %shr.1 = lshr i32 %bit_addr.addr.01, 5
; CHECK: %arrayidx.1 = getelementptr inbounds i32* %bitmap, i32 %shr.1
-; CHECK: while.body.2:
; CHECK: %shr.2 = lshr i32 %bit_addr.addr.01, 5
; CHECK: %arrayidx.2 = getelementptr inbounds i32* %bitmap, i32 %shr.2
-; CHECK: while.body.3:
; CHECK: %shr.3 = lshr i32 %bit_addr.addr.01, 5
; CHECK: %arrayidx.3 = getelementptr inbounds i32* %bitmap, i32 %shr.3
define void @FlipBit(i32* nocapture %bitmap, i32 %bit_addr, i32 %nbits) nounwind {