Commit a66051c
committed
[InstCombine] Add oneuse checks to shr + cmp constant folds.
This change has virtually no code size regressions on the llvm test suite (+ SPECs)
while having these improvements (measured with -Os on Darwin arm64):
External/S.../CFP2006/450.soplex/450.soplex 214024.00 213920.00 -0.0%
External/S...7speed/641.leela_s/641.leela_s 93412.00 93348.00 -0.1%
External/S...17rate/541.leela_r/541.leela_r 93412.00 93348.00 -0.1%
MultiSourc.../Applications/JM/lencod/lencod 426044.00 425748.00 -0.1%
MultiSourc...rks/mediabench/gsm/toast/toast 20436.00 20416.00 -0.1%
MultiSourc...ench/telecomm-gsm/telecomm-gsm 20436.00 20416.00 -0.1%
MultiSourc...Prolangs-C/assembler/assembler 16172.00 16156.00 -0.1%
MultiSourc...nch/mpeg2/mpeg2dec/mpeg2decode 35332.00 35256.00 -0.2%
SingleSour...Adobe-C++/stepanov_abstraction 6904.00 6888.00 -0.2%
External/SPEC/CINT2000/254.gap/254.gap 366060.00 365132.00 -0.3%
MultiSourc...-ProxyApps-C++/PENNANT/PENNANT 79688.00 79484.00 -0.3%
External/S...NT2006/464.h264ref/464.h264ref 352044.00 351132.00 -0.3%
SingleSour...arks/Adobe-C++/functionobjects 15524.00 15480.00 -0.3%
SingleSour...arks/Adobe-C++/stepanov_vector 10728.00 10696.00 -0.3%
SingleSour...ks/Misc-C++/stepanov_container 16900.00 16848.00 -0.3%
MultiSource/Applications/oggenc/oggenc 124184.00 123780.00 -0.3%
SingleSour...tout-C++/Shootout-C++-wordfreq 7060.00 7036.00 -0.3%
MultiSourc...ity-rijndael/security-rijndael 8976.00 8936.00 -0.4%
MultiSource/Benchmarks/McCat/18-imp/imp 9816.00 9772.00 -0.4%
SingleSour...chmarks/Misc-C++/stepanov_v1p2 1772.00 1764.00 -0.5%
MultiSourc...iabench/g721/g721encode/encode 5492.00 5464.00 -0.5%
MultiSourc...rks/McCat/03-testtrie/testtrie 1364.00 1344.00 -1.5%
SingleSour.../execute/GCC-C-execute-pr42833 400.00 364.00 -9.0%
Doing so also prevents a regression described in https://reviews.llvm.org/D143624
Differential Revision: https://reviews.llvm.org/D1499181 parent f9ead46 commit a66051c
File tree
4 files changed
+8
-13
lines changed- llvm
- lib/Transforms/InstCombine
- test/Transforms
- InstCombine
- PhaseOrdering
4 files changed
+8
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2451 | 2451 | | |
2452 | 2452 | | |
2453 | 2453 | | |
2454 | | - | |
| 2454 | + | |
2455 | 2455 | | |
2456 | 2456 | | |
2457 | 2457 | | |
| |||
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
900 | 900 | | |
901 | 901 | | |
902 | 902 | | |
903 | | - | |
| 903 | + | |
904 | 904 | | |
905 | 905 | | |
906 | 906 | | |
| |||
Lines changed: 3 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 22 | + | |
| 23 | + | |
28 | 24 | | |
29 | 25 | | |
30 | 26 | | |
| |||
0 commit comments