From 3d91966b0dcfe0bd0fc3a779a63d49546e46aea8 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 24 May 2020 20:07:49 -0700 Subject: qbe: Omit unnecessary add to help QBE's memopt pass --- test/struct-copy.qbe | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'test/struct-copy.qbe') 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 } -- cgit v1.2.3