Commit 132a448
committed
[DAGCombiner] Refactor and improve ReduceLoadOpStoreWidth
This patch make a couple of improvements to ReduceLoadOpStoreWidth.
When determining the minimum size of "NewBW" we now take byte
boundaries into account. If we for example touch bits 6-10 we
shouldn't accept NewBW=8, because we would fail later when detecting
that we can't access bits from two different bytes in memory using
a single load. Instead we make sure to align LSB/MSB according to
byte size boundaries up front before searching for a viable "NewBW".
In the past we only tried to find a "ShAmt" that was a multiple of
"NewBW", but now we use a sliding window technique to scan for a
viable "ShAmt" that is a multiple of the byte size. This can help
out finding more opportunities for optimization (specially if the
original type isn't byte sized, and for big-endian targets when
the original load/store is aligned on the most significant bit).
This is a follow up to a previous commit that made sure to no emit
load/store instructions access memory outside the the region touched
by the original load/store. In some situations that patch could lead
to minor regressions, but the new sliding window approach to find
the "ShAmt" is supposed to avoid such regressions.1 parent 3a13d83 commit 132a448
File tree
6 files changed
+82
-98
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/CodeGen
- ARM
- X86
- apx
6 files changed
+82
-98
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20339 | 20339 | | |
20340 | 20340 | | |
20341 | 20341 | | |
20342 | | - | |
| 20342 | + | |
20343 | 20343 | | |
20344 | 20344 | | |
20345 | 20345 | | |
20346 | 20346 | | |
20347 | 20347 | | |
20348 | 20348 | | |
20349 | 20349 | | |
20350 | | - | |
20351 | | - | |
20352 | | - | |
| 20350 | + | |
| 20351 | + | |
| 20352 | + | |
| 20353 | + | |
| 20354 | + | |
| 20355 | + | |
| 20356 | + | |
20353 | 20357 | | |
20354 | 20358 | | |
20355 | 20359 | | |
| |||
20364 | 20368 | | |
20365 | 20369 | | |
20366 | 20370 | | |
20367 | | - | |
20368 | | - | |
20369 | | - | |
20370 | | - | |
20371 | | - | |
20372 | | - | |
20373 | | - | |
20374 | | - | |
20375 | | - | |
20376 | | - | |
20377 | | - | |
20378 | | - | |
20379 | | - | |
20380 | | - | |
20381 | | - | |
20382 | | - | |
20383 | | - | |
20384 | | - | |
20385 | | - | |
20386 | | - | |
| 20371 | + | |
| 20372 | + | |
| 20373 | + | |
| 20374 | + | |
| 20375 | + | |
| 20376 | + | |
| 20377 | + | |
| 20378 | + | |
| 20379 | + | |
| 20380 | + | |
| 20381 | + | |
| 20382 | + | |
| 20383 | + | |
| 20384 | + | |
| 20385 | + | |
| 20386 | + | |
| 20387 | + | |
| 20388 | + | |
| 20389 | + | |
| 20390 | + | |
20387 | 20391 | | |
20388 | | - | |
20389 | | - | |
20390 | | - | |
20391 | | - | |
20392 | | - | |
20393 | | - | |
20394 | | - | |
20395 | | - | |
20396 | | - | |
20397 | | - | |
20398 | | - | |
| 20392 | + | |
| 20393 | + | |
| 20394 | + | |
| 20395 | + | |
| 20396 | + | |
20399 | 20397 | | |
| 20398 | + | |
20400 | 20399 | | |
20401 | 20400 | | |
20402 | | - | |
20403 | | - | |
20404 | | - | |
20405 | | - | |
20406 | | - | |
20407 | | - | |
20408 | | - | |
20409 | | - | |
20410 | | - | |
20411 | | - | |
20412 | | - | |
20413 | | - | |
20414 | | - | |
20415 | | - | |
20416 | | - | |
20417 | | - | |
20418 | | - | |
20419 | | - | |
20420 | | - | |
20421 | | - | |
20422 | | - | |
20423 | | - | |
20424 | | - | |
20425 | | - | |
20426 | | - | |
20427 | | - | |
| 20401 | + | |
| 20402 | + | |
| 20403 | + | |
| 20404 | + | |
| 20405 | + | |
20428 | 20406 | | |
| 20407 | + | |
| 20408 | + | |
| 20409 | + | |
| 20410 | + | |
| 20411 | + | |
| 20412 | + | |
| 20413 | + | |
| 20414 | + | |
| 20415 | + | |
| 20416 | + | |
| 20417 | + | |
| 20418 | + | |
| 20419 | + | |
| 20420 | + | |
| 20421 | + | |
| 20422 | + | |
| 20423 | + | |
| 20424 | + | |
| 20425 | + | |
| 20426 | + | |
| 20427 | + | |
| 20428 | + | |
| 20429 | + | |
| 20430 | + | |
| 20431 | + | |
| 20432 | + | |
| 20433 | + | |
20429 | 20434 | | |
20430 | 20435 | | |
20431 | 20436 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
906 | 906 | | |
907 | 907 | | |
908 | 908 | | |
909 | | - | |
| 909 | + | |
910 | 910 | | |
911 | 911 | | |
912 | 912 | | |
913 | 913 | | |
914 | 914 | | |
915 | | - | |
| 915 | + | |
916 | 916 | | |
917 | 917 | | |
918 | 918 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 9 | + | |
15 | 10 | | |
16 | 11 | | |
17 | 12 | | |
18 | 13 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 14 | + | |
25 | 15 | | |
26 | 16 | | |
27 | 17 | | |
| |||
103 | 93 | | |
104 | 94 | | |
105 | 95 | | |
106 | | - | |
| 96 | + | |
107 | 97 | | |
108 | 98 | | |
109 | 99 | | |
110 | 100 | | |
111 | | - | |
| 101 | + | |
112 | 102 | | |
113 | 103 | | |
114 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 17 | + | |
26 | 18 | | |
27 | 19 | | |
28 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 26 | + | |
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
| |||
0 commit comments