diff options
author | Michael Forney <mforney@mforney.org> | 2020-05-24 20:07:49 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2020-05-24 20:10:02 -0700 |
commit | 3d91966b0dcfe0bd0fc3a779a63d49546e46aea8 (patch) | |
tree | 82b972d68b11c32e1f26e05dd9e4bbfc7e7b802e /test/struct-copy.qbe | |
parent | 5ed26f909dd923dcd811784bc88efa46ad57bb30 (diff) |
qbe: Omit unnecessary add to help QBE's memopt pass
Diffstat (limited to 'test/struct-copy.qbe')
-rw-r--r-- | test/struct-copy.qbe | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/test/struct-copy.qbe b/test/struct-copy.qbe index 4778921..eb2c955 100644 --- a/test/struct-copy.qbe +++ b/test/struct-copy.qbe @@ -3,19 +3,18 @@ function $f() { @start.1 %.1 =l alloc4 12 @body.2 - %.2 =l add %.1, 0 - %.3 =l loaduw $x - storew %.3, %.2 - %.4 =l add $x, 4 - %.5 =l add %.2, 4 - %.6 =l loaduw %.4 - storew %.6, %.5 + %.2 =l loaduw $x + storew %.2, %.1 + %.3 =l add $x, 4 + %.4 =l add %.1, 4 + %.5 =l loaduw %.3 + storew %.5, %.4 + %.6 =l add %.3, 4 %.7 =l add %.4, 4 - %.8 =l add %.5, 4 - %.9 =l loaduw %.7 - storew %.9, %.8 + %.8 =l loaduw %.6 + storew %.8, %.7 + %.9 =l add %.6, 4 %.10 =l add %.7, 4 - %.11 =l add %.8, 4 ret } export data $x = align 4 { z 12 } |