gvn2.ssa 431 B

12345678910111213141516171819202122232425262728293031
  1. # GVN 0/non-0 inference removes @yesyes, @yesno, @noyes, @nono
  2. export
  3. function w $test(w %c) {
  4. @start
  5. jnz %c, @yes, @no
  6. @yes
  7. %c0 =w cnew %c, 0
  8. jnz %c0, @yesyes, @yesno
  9. @yesyes
  10. %rc =w copy 1
  11. jmp @end
  12. @yesno
  13. %rc =w copy 111
  14. jmp @end
  15. @no
  16. %c1 =w cnew %c, 0
  17. jnz %c1, @noyes, @nono
  18. @noyes
  19. %rc =w copy 222
  20. jmp @end
  21. @nono
  22. %rc =w copy 0
  23. @end
  24. ret %rc
  25. }
  26. # >>> driver
  27. # int test(int);
  28. # int main(void) { return test(0); }
  29. # <<<