blaise/vendor/qbe/test/gvn2.ssa
Graeme Geldenhuys c9dde987f0 vendor: update QBE from v1.2 to v1.3
QBE 1.3 (released 2026-06-01) adds Windows AMD64 ABI support
(amd64_win target), improved PIC via extern symbol constants,
GVN/GCM optimisation passes, if-conversion, and various
correctness and performance fixes.

All 2293 compiler tests pass against the new QBE binary.
2026-06-02 16:54:51 +01: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); }
# <<<