aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/LoopIndexSplit/PR3913.ll
blob: 181633300a5d47555b2d53ed53398ac953463887 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
; RUN: opt %s -loop-index-split | llvm-dis | not grep "icmp ne"

define i32 @main() {
entry:
	br label %header

header:
	%r = phi i32 [ 0, %entry ], [ %r3, %skip ]
	%i = phi i32 [ 0, %entry ], [ %i1, %skip ]
	%cond = icmp eq i32 %i, 99
	br i1 %cond, label %body, label %skip

body:
	br label %skip

skip:
	%r3 = phi i32 [ %r, %header ], [ 3, %body ]
	%i1 = add i32 %i, 1
	%exitcond = icmp eq i32 %i1, 10
	br i1 %exitcond, label %exit, label %header

exit:
	ret i32 %r3
}