Move the Thumb2SizeReduce pass to before IfConversion when optimising
for minimal code size.
Running the Thumb2SizeReduction pass before IfConversion allows T1 instructions
to propagate to the final output, rather than the ifConverter modifying T2
instructions and preventing them from being reduced later.
This change does introduce a regression regarding execution time, so it's only
applied when optimising for size.
Running the LLVM Test Suite with this change produces a geomean
difference of -0.1% for the size..text metric.
LLVM Test suite results:
Tests: 310
Metric: size..text
Program | Initial | Modified | diff |
---|---|---|---|
test-suite.../Applications/sgefa/sgefa.test | 6152 | 6096 | -0.9% |
test-suite...ks/Prolangs-C/agrep/agrep.test | 24100 | 23884 | -0.9% |
test-suite.../Benchmarks/Stanford/Perm.test | 524 | 520 | -0.8% |
test-suite...rks/FreeBench/mason/mason.test | 1232 | 1224 | -0.6% |
test-suite.../Trimaran/enc-rc4/enc-rc4.test | 656 | 652 | -0.6% |
test-suite...itBench/uudecode/uudecode.test | 664 | 660 | -0.6% |
test-suite...Benchmarks/Stanford/Oscar.test | 1344 | 1336 | -0.6% |
test-suite...ks/Shootout/Shootout-hash.test | 1360 | 1352 | -0.6% |
test-suite...nch/fourinarow/fourinarow.test | 4336 | 4312 | -0.6% |
test-suite...ch/g721/g721encode/encode.test | 3816 | 3796 | -0.5% |
test-suite...itBench/uuencode/uuencode.test | 796 | 792 | -0.5% |
test-suite.../Benchmarks/Dhrystone/dry.test | 820 | 816 | -0.5% |
test-suite...count/automotive-bitcount.test | 1824 | 1816 | -0.4% |
test-suite...marks/Olden/bisort/bisort.test | 1832 | 1824 | -0.4% |
test-suite...CI_Purple/SMG2000/smg2000.test | 89904 | 89512 | -0.4% |
Geomean difference -0.1%
Initial | Modified | diff | |
---|---|---|---|
count | 310.000000 | 310.000000 | 310.000000 |
mean | 19649.870968 | 19629.354839 | -0.000601 |
std | 48795.053450 | 48742.740588 | 0.001539 |
min | 292.000000 | 292.000000 | -0.009103 |
25% | 1090.000000 | 1090.000000 | -0.000648 |
50% | 2770.000000 | 2772.000000 | 0.000000 |
75% | 10185.000000 | 10185.000000 | 0.000000 |
max | 324040.000000 | 323540.000000 | 0.003704 |
Feel free to make this into more of a sentence too, with Capitalization and a full stop.