aboutsummaryrefslogtreecommitdiff
path: root/test/conditional-compound-literal.qbe
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2020-05-24 20:07:49 -0700
committerMichael Forney <mforney@mforney.org>2020-05-24 20:10:02 -0700
commit3d91966b0dcfe0bd0fc3a779a63d49546e46aea8 (patch)
tree82b972d68b11c32e1f26e05dd9e4bbfc7e7b802e /test/conditional-compound-literal.qbe
parent5ed26f909dd923dcd811784bc88efa46ad57bb30 (diff)
qbe: Omit unnecessary add to help QBE's memopt pass
Diffstat (limited to 'test/conditional-compound-literal.qbe')
-rw-r--r--test/conditional-compound-literal.qbe27
1 files changed, 12 insertions, 15 deletions
diff --git a/test/conditional-compound-literal.qbe b/test/conditional-compound-literal.qbe
index 9e9c5f7..013d179 100644
--- a/test/conditional-compound-literal.qbe
+++ b/test/conditional-compound-literal.qbe
@@ -2,24 +2,21 @@ export
function w $main() {
@start.1
%.1 =l alloc4 4
- %.3 =l alloc8 8
- %.6 =l alloc4 4
+ %.2 =l alloc8 8
+ %.4 =l alloc4 4
@body.2
- %.2 =l add %.1, 0
- storew 0, %.2
- %.4 =l add %.3, 0
- %.5 =w cnew 0, 0
- jnz %.5, @cond_true.3, @cond_false.4
+ storew 0, %.1
+ %.3 =w cnew 0, 0
+ jnz %.3, @cond_true.3, @cond_false.4
@cond_true.3
jmp @cond_join.5
@cond_false.4
- %.7 =l add %.6, 0
- %.8 =w loadsw %.1
- storew %.8, %.7
+ %.5 =w loadsw %.1
+ storew %.5, %.4
@cond_join.5
- %.9 =l phi @cond_true.3 0, @cond_false.4 %.6
- storel %.9, %.4
- %.10 =l loadl %.3
- %.11 =w loadsw %.10
- ret %.11
+ %.6 =l phi @cond_true.3 0, @cond_false.4 %.4
+ storel %.6, %.2
+ %.7 =l loadl %.2
+ %.8 =w loadsw %.7
+ ret %.8
}