summaryrefslogtreecommitdiff
path: root/test/Transforms/LICM/2003-12-11-SinkingToPHI.ll
blob: ecbc130e8739f84b5d75ad86772951ca453b6a71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
; RUN: llvm-as < %s | opt -licm | lli

implementation   ; Functions:

int %main() {
entry:
	br label %Loop

Loop:
	br bool true, label %LoopCont, label %Out
LoopCont:
	%X = add int 1, 0
	br bool true, label %Out, label %Loop

Out:
	%V = phi int [ 2, %Loop], [ %X, %LoopCont]
	%V2 = sub int %V, 1
	ret int %V2
}