Files
cell/src/qbe/test/gvn2.ssa
2026-02-17 10:23:47 -06:00

32 lines
431 B
Plaintext

# 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); }
# <<<