summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopReroll/basic.ll
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2015-02-16 17:02:00 +0000
committerJames Molloy <james.molloy@arm.com>2015-02-16 17:02:00 +0000
commite32d806b5faac6533adabf00bdc1cf5284cfe5e6 (patch)
tree81fefdd9e13cd830a5fbb9129385200364d2a8b9 /llvm/test/Transforms/LoopReroll/basic.ll
parent4c7deb2259cc12fc7f70f71eec76bebc8dfaf727 (diff)
downloadbcm5719-llvm-e32d806b5faac6533adabf00bdc1cf5284cfe5e6.tar.gz
bcm5719-llvm-e32d806b5faac6533adabf00bdc1cf5284cfe5e6.zip
[LoopReroll] Relax some assumptions a little.
We won't find a root with index zero in any loop that we are able to reroll. However, we may find one in a non-rerollable loop, so bail gracefully instead of failing hard. llvm-svn: 229406
Diffstat (limited to 'llvm/test/Transforms/LoopReroll/basic.ll')
-rw-r--r--llvm/test/Transforms/LoopReroll/basic.ll30
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopReroll/basic.ll b/llvm/test/Transforms/LoopReroll/basic.ll
index f30f417f17a..75334611d5f 100644
--- a/llvm/test/Transforms/LoopReroll/basic.ll
+++ b/llvm/test/Transforms/LoopReroll/basic.ll
@@ -545,6 +545,36 @@ for.end: ; preds = %for.body
ret void
}
+%struct.s = type { i32, i32 }
+
+; Function Attrs: nounwind uwtable
+define void @gep1(%struct.s* nocapture %x) #0 {
+entry:
+ %call = tail call i32 @foo(i32 0) #1
+ br label %for.body
+
+for.body: ; preds = %for.body, %entry
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %0 = mul nsw i64 %indvars.iv, 3
+ %arrayidx = getelementptr inbounds %struct.s* %x, i64 %0, i32 0
+ store i32 %call, i32* %arrayidx, align 4
+ %1 = add nsw i64 %0, 1
+ %arrayidx4 = getelementptr inbounds %struct.s* %x, i64 %1, i32 0
+ store i32 %call, i32* %arrayidx4, align 4
+ %2 = add nsw i64 %0, 2
+ %arrayidx9 = getelementptr inbounds %struct.s* %x, i64 %2, i32 0
+ store i32 %call, i32* %arrayidx9, align 4
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 500
+ br i1 %exitcond, label %for.end, label %for.body
+
+; CHECK-LABEL: @gep1
+; This test is a crash test only.
+; CHECK: ret
+for.end: ; preds = %for.body
+ ret void
+}
+
attributes #0 = { nounwind uwtable }
attributes #1 = { nounwind }
OpenPOWER on IntegriCloud