qbe/test/gvn2.ssa
Quentin Carbonneaux f3ca257737 gvn/gcm review
- Many stylistic nits.
- Removed blkmerge().
- Some minor bug fixes.
- GCM reassoc is now "sink"; a pass that
  moves trivial ops in their target block
  with the same goal of reducing register
  pressure, but starting from instructions
  that benefit from having their inputs
  close.
2025-03-14 13:09:21 +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); }
# <<<