aboutsummaryrefslogtreecommitdiff
path: root/test/gvn2.ssa
blob: 33f9a9630fbff5d09e2c8b44dd62f7f03f2084ec (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
# GVN 0/non-0 inference removes @yesyes, @yesno, @noyes, @nono

export
function w $test(w %c) {
@start
	jnz %c, @yes, @no
@yes
	%c0 =w cnew %c, 0
	jnz %c0, @yesyes, @yesno
@yesyes
	%rc =w copy 1
	jmp @end
@yesno
	%rc =w copy 111
	jmp @end
@no
	%c1 =w cnew %c, 0
	jnz %c1, @noyes, @nono
@noyes
	%rc =w copy 222
	jmp @end
@nono
	%rc =w copy 0
@end
	ret %rc
}

# >>> driver
# int test(int);
# int main(void) { return test(0); }
# <<<