aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/CorrelatedExprs/2002-10-08-DominatorTest.ll
blob: 8ae34545716db3d0d3454980fd422aa1b99ee7e5 (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
25
26
27
28
29
30
31
32
; Test to make sure that SSA is correctly updated
; RUN: as < %s | opt -cee
;
implementation   ; Functions:

int %test(int %A, int %B, bool %c0) {
Start:		; No predecessors!
	%c1 = seteq int %A, %B		; <bool> [#uses=1]
	br bool %c1, label %Eq, label %Start_crit_edge

Start_crit_edge:		; preds = %Start
	br label %Loop

Eq:		; preds = %Start
	br label %Loop

Loop:		; preds = %Bottom, %Eq, %Start_crit_edge
	%Z = phi int [ %A, %Start_crit_edge ], [ %B, %Eq ], [ %Z, %Bottom ]		; <int> [#uses=2]
	%c2 = setge int %A, %B		; <bool> [#uses=1]
	br bool %c2, label %Forwarded, label %Loop_crit_edge

Loop_crit_edge:		; preds = %Loop
	br label %Bottom

Forwarded:		; preds = %Loop
	%Z2 = phi int [ %Z, %Loop ]		; <int> [#uses=1]
	call int %test( int 0, int %Z2, bool true )		; <int>:0 [#uses=0]
	br label %Bottom

Bottom:		; preds = %Forwarded, %Loop_crit_edge
	br label %Loop
}