annotate llvm/test/Transforms/LoopUnroll/runtime-loop-non-exiting-latch.ll @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children 1f2b6ac9f198
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; REQUIRES: asserts
anatofuz
parents:
diff changeset
2 ; RUN: opt < %s -S -loop-unroll -unroll-runtime=true -unroll-allow-remainder=true -unroll-count=4
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 ; Make sure that the runtime unroll does not break with a non-exiting latch.
anatofuz
parents:
diff changeset
5 define i32 @test(i32* %a, i32* %b, i32* %c, i64 %n) {
anatofuz
parents:
diff changeset
6 entry:
anatofuz
parents:
diff changeset
7 br label %while.cond
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 while.cond: ; preds = %while.body, %entry
anatofuz
parents:
diff changeset
10 %i.0 = phi i64 [ 0, %entry ], [ %inc, %while.body ]
anatofuz
parents:
diff changeset
11 %cmp = icmp slt i64 %i.0, %n
anatofuz
parents:
diff changeset
12 br i1 %cmp, label %while.body, label %while.end
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 while.body: ; preds = %while.cond
anatofuz
parents:
diff changeset
15 %arrayidx = getelementptr inbounds i32, i32* %b, i64 %i.0
anatofuz
parents:
diff changeset
16 %0 = load i32, i32* %arrayidx
anatofuz
parents:
diff changeset
17 %arrayidx1 = getelementptr inbounds i32, i32* %c, i64 %i.0
anatofuz
parents:
diff changeset
18 %1 = load i32, i32* %arrayidx1
anatofuz
parents:
diff changeset
19 %mul = mul nsw i32 %0, %1
anatofuz
parents:
diff changeset
20 %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %i.0
anatofuz
parents:
diff changeset
21 store i32 %mul, i32* %arrayidx2
anatofuz
parents:
diff changeset
22 %inc = add nsw i64 %i.0, 1
anatofuz
parents:
diff changeset
23 br label %while.cond
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 while.end: ; preds = %while.cond
anatofuz
parents:
diff changeset
26 ret i32 0
anatofuz
parents:
diff changeset
27 }