qbe/test/gvn1.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

20 lines
310 B
Plaintext

export
function w $test(w %p1, w %p2) {
@start
@entry
%t1 =w copy 1
jnz %t1, @live, @dead1
@live
%t2 =w add %p1, %p2
ret %t2
@dead1
%t2 =w add %p1, %p2 # live ins in dead blk
@dead2
jnz %t1, @live, @dead1
}
# >>> driver
# extern int test(int p1, int p2);
# int main() { return test(1, 2) != 3; }
# <<<