This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Unrestrict Armv8-a IT when at minsize
ClosedPublic

Authored by samparker on Aug 10 2020, 4:35 AM.

Details

Summary

IT blocks with more than one instruction were performance deprecated in Armv8 but that doesn't mean we should follow that advise when optimising for size.

Program                                                                                              armv8a-default armv8a-unrestrict diff
                      test-suite :: MultiSource/Benchmarks/mediabench/adpcm/rawcaudio/rawcaudio.test     796            780           -2.0%
                      test-suite :: MultiSource/Benchmarks/mediabench/adpcm/rawdaudio/rawdaudio.test     796            780           -2.0%
                                                 test-suite :: MultiSource/Applications/aha/aha.test    1996           1964           -1.6%
                                          test-suite :: MultiSource/Benchmarks/McCat/18-imp/imp.test    6940           6844           -1.4%
                            test-suite :: MultiSource/Benchmarks/Fhourstones-3.1/fhourstones3.1.test    2988           2948           -1.3%
                 test-suite :: MultiSource/Benchmarks/MiBench/automotive-susan/automotive-susan.test   14064          13900           -1.2%
                         test-suite :: MultiSource/Benchmarks/mediabench/g721/g721encode/encode.test    3852           3808           -1.1%
                                  test-suite :: SingleSource/Benchmarks/Shootout/Shootout-sieve.test     364            360           -1.1%
                           test-suite :: MultiSource/Benchmarks/FreeBench/fourinarow/fourinarow.test    4376           4328           -1.1%
                                         test-suite :: SingleSource/Benchmarks/Misc/ReedSolomon.test    2312           2288           -1.0%
                                    test-suite :: SingleSource/Benchmarks/CoyoteBench/huffbench.test    1552           1536           -1.0%
                                               test-suite :: MultiSource/Benchmarks/PAQ8p/paq8p.test   40808          40416           -1.0%
                           test-suite :: SingleSource/Benchmarks/Shootout-C++/Shootout-C++-hash.test    1788           1772           -0.9%
                                   test-suite :: MultiSource/Benchmarks/ASC_Sequoia/AMGmk/AMGmk.test    6540           6484           -0.9%
                                       test-suite :: SingleSource/Benchmarks/Misc-C++-EH/spirit.test   32624          32348           -0.8%
                                           test-suite :: MultiSource/Benchmarks/Olden/em3d/em3d.test    1932           1916           -0.8%
                                                   test-suite :: MultiSource/Benchmarks/sim/sim.test    8032           7968           -0.8%
                          test-suite :: SingleSource/Benchmarks/Shootout-C++/Shootout-C++-hash2.test    2012           1996           -0.8%
                                           test-suite :: SingleSource/Benchmarks/Misc/whetstone.test    1616           1604           -0.7%
                                    test-suite :: MultiSource/Benchmarks/Prolangs-C++/life/life.test    1084           1076           -0.7%
                                             test-suite :: SingleSource/Benchmarks/McGill/chomp.test    1672           1660           -0.7%
                                       test-suite :: MultiSource/Benchmarks/Olden/bisort/bisort.test    1120           1112           -0.7%
                      test-suite :: SingleSource/Benchmarks/Shootout-C++/EH/Shootout-C++-except.test     568            564           -0.7%
                         test-suite :: MultiSource/Benchmarks/MiBench/security-sha/security-sha.test    1180           1172           -0.7%
                        test-suite :: MultiSource/Benchmarks/Trimaran/netbench-url/netbench-url.test    1808           1796           -0.7%
                                         test-suite :: MultiSource/Applications/SIBsim4/SIBsim4.test   18892          18768           -0.7%
                                     test-suite :: MultiSource/Benchmarks/FreeBench/mason/mason.test    1232           1224           -0.6%
                         test-suite :: SingleSource/Benchmarks/Shootout-C++/Shootout-C++-lists1.test    1248           1240           -0.6%
                                       test-suite :: MultiSource/Applications/hexxagon/hexxagon.test    7296           7252           -0.6%
                                test-suite :: MultiSource/Benchmarks/BitBench/uudecode/uudecode.test     664            660           -0.6%
                                test-suite :: SingleSource/Benchmarks/BenchmarkGame/Large/fasta.test     668            664           -0.6%
                                   test-suite :: MultiSource/Benchmarks/FreeBench/neural/neural.test    2684           2668           -0.6%
                                             test-suite :: MultiSource/Applications/sgefa/sgefa.test    5404           5372           -0.6%
                                           test-suite :: SingleSource/Benchmarks/Stanford/Oscar.test    1352           1344           -0.6%
                                    test-suite :: MultiSource/Benchmarks/VersaBench/8b10b/8b10b.test     692            688           -0.6%
                                test-suite :: MultiSource/Benchmarks/Prolangs-C++/employ/employ.test    2092           2104            0.6%
                           test-suite :: MultiSource/Benchmarks/FreeBench/pcompress2/pcompress2.test    2828           2812           -0.6%
                                        test-suite :: MultiSource/Applications/JM/ldecod/ldecod.test  127424         126708           -0.6%
                                         test-suite :: MultiSource/Applications/minisat/minisat.test   10044           9988           -0.6%
                                             test-suite :: MultiSource/Benchmarks/Ptrdist/bc/bc.test   19544          19436           -0.6%
                                             test-suite :: MultiSource/Applications/spiff/spiff.test   10904          10844           -0.6%
                                    test-suite :: MultiSource/Benchmarks/Prolangs-C/agrep/agrep.test   22588          22468           -0.5%
                                          test-suite :: MultiSource/Benchmarks/NPB-serial/is/is.test    1508           1500           -0.5%
                                         test-suite :: MultiSource/Applications/ClamAV/clamscan.test  246368         245132           -0.5%
                                     test-suite :: MultiSource/Applications/lambda-0.1.3/lambda.test   13244          13180           -0.5%
                           test-suite :: MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/miniFE.test   29248          29108           -0.5%
                                test-suite :: MultiSource/Benchmarks/mediabench/gsm/toast/toast.test   15136          15072           -0.4%
                         test-suite :: MultiSource/Benchmarks/MiBench/telecomm-gsm/telecomm-gsm.test   15136          15072           -0.4%
                       test-suite :: MultiSource/Benchmarks/MiBench/consumer-lame/consumer-lame.test   68228          67940           -0.4%
                                           test-suite :: MultiSource/Applications/oggenc/oggenc.test   88308          87940           -0.4%
                                  test-suite :: SingleSource/Benchmarks/Shootout/Shootout-lists.test     960            956           -0.4%
                                             test-suite :: MultiSource/Applications/SPASS/SPASS.test  200896         200064           -0.4%
                                            test-suite :: SingleSource/Benchmarks/McGill/queens.test     980            976           -0.4%
                                    test-suite :: MultiSource/Benchmarks/Prolangs-C/gnugo/gnugo.test    7856           7824           -0.4%
                        test-suite :: SingleSource/Benchmarks/Shootout-C++/Shootout-C++-moments.test    1980           1972           -0.4%
                                          test-suite :: MultiSource/Benchmarks/McCat/09-vor/vor.test    5136           5116           -0.4%
                           test-suite :: MultiSource/Benchmarks/DOE-ProxyApps-C/miniAMR/miniAMR.test   30872          30752           -0.4%
                                                 test-suite :: MultiSource/Applications/lua/lua.test   60312          60080           -0.4%
                             test-suite :: MultiSource/Benchmarks/MallocBench/espresso/espresso.test   67796          67536           -0.4%
                                         test-suite :: MultiSource/Applications/sqlite3/sqlite3.test  167448         166808           -0.4%
                                   test-suite :: MultiSource/Benchmarks/Fhourstones/fhourstones.test    4212           4196           -0.4%
                                       test-suite :: MultiSource/Benchmarks/SciMark2-C/scimark2.test    4228           4212           -0.4%
                                  test-suite :: MultiSource/Benchmarks/Prolangs-C++/ocean/ocean.test    2176           2168           -0.4%
                                      test-suite :: MultiSource/Benchmarks/mafft/pairlocalalign.test  167628         167012           -0.4%
                                  test-suite :: MultiSource/Benchmarks/Trimaran/enc-pc1/enc-pc1.test    1092           1088           -0.4%
                 test-suite :: MultiSource/Benchmarks/MiBench/network-patricia/network-patricia.test    1096           1092           -0.4%
                                    test-suite :: SingleSource/Benchmarks/CoyoteBench/almabench.test    2232           2224           -0.4%
                                     test-suite :: SingleSource/Benchmarks/Misc-C++/oopack_v1p8.test    2256           2248           -0.4%
                                        test-suite :: MultiSource/Applications/JM/lencod/lencod.test  317712         316600           -0.4%
           test-suite :: MultiSource/Benchmarks/MiBench/automotive-bitcount/automotive-bitcount.test    1176           1172           -0.3%
                         test-suite :: MultiSource/Benchmarks/DOE-ProxyApps-C++/PENNANT/PENNANT.test   32428          32320           -0.3%
                     test-suite :: MultiSource/Benchmarks/mediabench/mpeg2/mpeg2dec/mpeg2decode.test   22352          22280           -0.3%
                                     test-suite :: SingleSource/Benchmarks/CoyoteBench/fftbench.test    2532           2524           -0.3%
                              test-suite :: SingleSource/Benchmarks/Misc-C++/stepanov_container.test    9036           9008           -0.3%
                                  test-suite :: MultiSource/Benchmarks/Prolangs-C/bison/mybison.test   26288          26208           -0.3%
                               test-suite :: MultiSource/Benchmarks/FreeBench/analyzer/analyzer.test    3980           3968           -0.3%
                                      test-suite :: SingleSource/Benchmarks/CoyoteBench/lpbench.test    1376           1372           -0.3%
                                             test-suite :: MultiSource/Benchmarks/Olden/mst/mst.test    1428           1424           -0.3%
                                  test-suite :: SingleSource/Benchmarks/Misc/richards_benchmark.test    1432           1428           -0.3%
                                   test-suite :: MultiSource/Benchmarks/MallocBench/cfrac/cfrac.test   11624          11592           -0.3%
                                       test-suite :: MultiSource/Benchmarks/Ptrdist/yacr2/yacr2.test   10632          10604           -0.3%
                                          test-suite :: MultiSource/Applications/d/make_dparser.test   42548          42440           -0.3%
                                     test-suite :: MultiSource/Benchmarks/FreeBench/pifft/pifft.test   23684          23624           -0.3%
                                       test-suite :: MultiSource/Benchmarks/7zip/7zip-benchmark.test  324948         324144           -0.2%
                                         test-suite :: MultiSource/Benchmarks/MallocBench/gs/gs.test   76676          76488           -0.2%
                                         test-suite :: MultiSource/Applications/obsequi/Obsequi.test   16536          16496           -0.2%
                                               test-suite :: MultiSource/Applications/siod/siod.test   45844          45740           -0.2%
                                test-suite :: SingleSource/Benchmarks/Adobe-C++/functionobjects.test    7512           7496           -0.2%
                             test-suite :: MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/CLAMR.test  218172         217708           -0.2%
                       test-suite :: MultiSource/Benchmarks/MiBench/consumer-jpeg/consumer-jpeg.test   58564          58440           -0.2%
                                   test-suite :: MultiSource/Benchmarks/Ptrdist/anagram/anagram.test    1940           1944            0.2%
                                             test-suite :: MultiSource/Benchmarks/Olden/tsp/tsp.test    1944           1940           -0.2%
                                            test-suite :: MultiSource/Applications/kimwitu++/kc.test  243004         242516           -0.2%
                                      test-suite :: MultiSource/Benchmarks/VersaBench/dbms/dbms.test    8252           8236           -0.2%
                           test-suite :: MultiSource/Benchmarks/DOE-ProxyApps-C/RSBench/rsbench.test    8304           8288           -0.2%
                                  test-suite :: MicroBenchmarks/LCALS/SubsetCRawLoops/lcalsCRaw.test   91684          91508           -0.2%
                            test-suite :: MicroBenchmarks/LCALS/SubsetBLambdaLoops/lcalsBLambda.test   86884          86740           -0.2%
                                  test-suite :: MicroBenchmarks/LoopInterchange/LoopInterchange.test   59976          59880           -0.2%
                                    test-suite :: MicroBenchmarks/ImageProcessing/Dilate/Dilate.test   61224          61128           -0.2%
        test-suite :: MicroBenchmarks/ImageProcessing/AnisotropicDiffusion/AnisotropicDiffusion.test   61528          61432           -0.2%
                      test-suite :: MultiSource/Benchmarks/TSVC/ControlFlow-dbl/ControlFlow-dbl.test   12888          12868           -0.2%
                                        test-suite :: MicroBenchmarks/ImageProcessing/Blur/blur.test   61864          61768           -0.2%
                      test-suite :: MicroBenchmarks/ImageProcessing/Interpolation/Interpolation.test   61960          61864           -0.2%
                                    test-suite :: MicroBenchmarks/ImageProcessing/Dither/Dither.test   62088          61992           -0.2%
                                                    test-suite :: MicroBenchmarks/harris/harris.test   62280          62184           -0.2%
                             test-suite :: MultiSource/Benchmarks/mediabench/jpeg/jpeg-6a/cjpeg.test   60464          60372           -0.2%
                                test-suite :: SingleSource/Benchmarks/Adobe-C++/stepanov_vector.test    7996           7984           -0.2%
                           test-suite :: MultiSource/Benchmarks/DOE-ProxyApps-C/XSBench/XSBench.test    5388           5380           -0.1%
                                             test-suite :: MultiSource/Benchmarks/Ptrdist/ks/ks.test    2764           2760           -0.1%
                                               test-suite :: MultiSource/Benchmarks/Olden/bh/bh.test    6180           6172           -0.1%
                                  test-suite :: MicroBenchmarks/LCALS/SubsetARawLoops/lcalsARaw.test   89668          89556           -0.1%
                            test-suite :: MicroBenchmarks/LCALS/SubsetALambdaLoops/lcalsALambda.test   90452          90340           -0.1%
                       test-suite :: MultiSource/Benchmarks/DOE-ProxyApps-C/SimpleMOC/SimpleMOC.test   13308          13292           -0.1%
                     test-suite :: MultiSource/Benchmarks/DOE-ProxyApps-C/Pathfinder/PathFinder.test   10600          10612            0.1%
                               test-suite :: MultiSource/Benchmarks/ASCI_Purple/SMG2000/smg2000.test   88952          88860           -0.1%
                          test-suite :: MultiSource/Applications/ALAC/decode/alacconvert-decode.test   19932          19912           -0.1%
                          test-suite :: MultiSource/Applications/ALAC/encode/alacconvert-encode.test   19932          19912           -0.1%
                                test-suite :: MultiSource/Benchmarks/Trimaran/enc-3des/enc-3des.test    8104           8096           -0.1%
                                     test-suite :: MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4.test  198820         198628           -0.1%
                                    test-suite :: MultiSource/Benchmarks/Prolangs-C++/city/city.test    4216           4212           -0.1%
                                             test-suite :: MultiSource/Benchmarks/Bullet/bullet.test  296292         296012           -0.1%
                      test-suite :: MultiSource/Benchmarks/TSVC/ControlFlow-flt/ControlFlow-flt.test   13372          13360           -0.1%
                                 test-suite :: MultiSource/Benchmarks/DOE-ProxyApps-C/CoMD/CoMD.test   18684          18668           -0.1%
                                             test-suite :: MultiSource/Benchmarks/nbench/nbench.test   15516          15504           -0.1%
                           test-suite :: MultiSource/Benchmarks/DOE-ProxyApps-C/miniGMG/miniGMG.test   25336          25320           -0.1%
                             test-suite :: MultiSource/Benchmarks/DOE-ProxyApps-C++/HPCCG/HPCCG.test    7132           7128           -0.1%
               test-suite :: MultiSource/Benchmarks/MiBench/security-rijndael/security-rijndael.test    7800           7796           -0.1%

Geomean difference                                  -0.2%

Diff Detail

Event Timeline

samparker created this revision.Aug 10 2020, 4:35 AM
samparker requested review of this revision.Aug 10 2020, 4:35 AM
samparker edited the summary of this revision. (Show Details)

Source changes look good to me, just a few test-related points to address.

llvm/test/CodeGen/ARM/codesize-ifcvt.mir
2–3

Nit: Shouldn't this be CHECK-V7? I haven't seen any tests that don't follow that convention.

2–4

Could we also have a test for V8 with -Oz? Given that that is what this change effects most

223–251

Is any of this needed now? It looks identical to the V7 block.

samparker added inline comments.Aug 10 2020, 5:21 AM
llvm/test/CodeGen/ARM/codesize-ifcvt.mir
2–3

fair enough.

2–4

-Oz is a clang frontend option so we can't use it for testing with llc. With LLVM IR, we attach attributes on the functions for optsize (Os) and minsize (Oz):

attributes #0 = { optsize }
attributes #1 = { minsize }
223–251

Ah! cheers.

samparker updated this revision to Diff 284326.Aug 10 2020, 5:30 AM

Amended test.

NickGuy accepted this revision.Aug 10 2020, 5:51 AM

LGTM, if no one else has any issues.

llvm/test/CodeGen/ARM/codesize-ifcvt.mir
2–3

Thanks

2–4

Ah, I'd missed that part. Ignore me here :)

223–251

👍

This revision is now accepted and ready to land.Aug 10 2020, 5:51 AM
This revision was automatically updated to reflect the committed changes.