mcs51: track register equality
I also have a patch for the "need pointerCode" assert, as attached.
Of course there were some bugs, but the regression test is passing now. $ grep "(f:" regtest-before.log | sed -e 's@.*b:\([^,]*\), T:\([^)]*\))@b: \1 T: \2@' | awk 'BEGIN { b = 0; t = 0 } { b += $2; t += $4 } END { print "b:", b, "T:", t }' b: 76397798 T: 10330885752 $ grep "(f:" regtest-after.log | sed -e 's@.*b:\([^,]*\), T:\([^)]*\))@b: \1 T: \2@' | awk 'BEGIN { b = 0; t = 0 } { b += $2; t += $4 } END { print "b:", b, "T:", t }' b: 76397020 T: 10330860444 $ grep "failures" regtest-after.log Summary...
$ grep "(f:" regtest-before.log | sed -e 's@.*b:\([^,]*\), T:\([^)]*\))@b: \1 T: \2@' | awk 'BEGIN { b = 0; t = 0 } { b += $2; t += $4 } END { print "b:", b, "T:", t }' b: 76390042 T: 10330159128 $ grep "(f:" regtest-after.log | sed -e 's@.*b:\([^,]*\), T:\([^)]*\))@b: \1 T: \2@' | awk 'BEGIN { b = 0; t = 0 } { b += $2; t += $4 } END { print "b:", b, "T:", t }' b: 76389574 T: 10330144896 So 468 bytes saved over all testcases?
$ grep "(f:" regtest-before.log | sed -e 's@.*b:\([^,]*\), T:\([^)]*\))@b: \1 T: \2@ | awk 'BEGIN { b = 0; t = 0 } { b += $2; t += $4 } END { print "b:", b, "T:", t }' b: 76390042 T: 10330159128 $ grep "(f:" regtest-after.log | sed -e 's@.*b:\([^,]*\), T:\([^)]*\))@b: \1 T: \2@ | awk 'BEGIN { b = 0; t = 0 } { b += $2; t += $4 } END { print "b:", b, "T:", t }' b: 76389574 T: 10330144896 So 468 bytes saved over all testcases?
Grepping over the regression test: 273 hits for "Peephole 4242.a" 120 hits for "Peephole 4242.b" 288 hits for "Peephole 4242.c" 0 hits for "Peephole hoisted temporary update out of loop" 0 hits for "Peephole optimized decrement, merged into previous" 0 hits for "Peephole removed redundant move before return" [edit]Some regressions found compared to unmodified baseline, need to check where the mov , dpl corruption is coming from... Unfortunately notSame(%1, '') is not accepted, so for now I fixed...
550 hits for "Peephole modified moves to enable further optimizations" That said, sampling the hits it is often only a change with no further effect (no change in size or speed). But it has some successes, for example in support/regression/gen/mcs51-medium/rotate2/rotate2_size_16_andCase_1_xorLiteral_1_rotateLeft_0_structVar_0.asm: $ diff -Naru build-{unmodified,subcarry-peeph}/support/regression/gen/mcs51-medium/rotate2/rotate2_size_16_andCase_1_xorLiteral_1_rotateLeft_0_structVar_0.asm --- build-unmodified/support/regression/gen/mcs51-medium/rotate2/rotate2_size_16_andCase_1_xorLiteral_1_rotateLeft_0_structVar_0.asm...
Grepping over the regression test: 550 hits for "Peephole modified moves to enable further optimizations" 0 hits for "Peephole hoisted temporary update out of loop" 0 hits for "Peephole optimized decrement, merged into previous" 0 hits for "Peephole removed redundant move before return" [edit]Some regressions found compared to unmodified baseline, need to check where the mov , dpl corruption is coming from... Unfortunately notSame(%1, '') is not accepted, so for now I fixed it by duplicating the...