Commit 6ac7c16
committed
[AArch64][SVE] Refactor getPTrue to return splat(1) when pattern=all.
Similarly to llvm#135016, refactor getPTrue to return splat (1) for
all-active patterns. The main motivation for this is to improve code gen
for fixed-length vector loads/stores that are lowered to SVE masked
memory ops when they are wider than Neon. Emitting the mask as a splat
helps DAGCombiner simplify all-active masked loads/stores into unmaked
ones, for which we already have suitable patterns.
There are four places in AArch64ISelLowering that match against
AArch64ISD::PTRUE opcodes explicitly. Of these, only one
(foldCSELofLASTB) led to test regressions, which I addressed by adding a
check for ISD::isConstantSplatVectorAllOnes (I'm not sure if the intent
here is to genuinely match any PTRUE node, or if isAllActivePredicate
should be used instead). The other three combines (performUnpackCombine,
performMSTORECombine and performSetCCPunpkCombine) check for patterns in
the range [VL1, VL256], so those should already skip all-active masks.
Given the recent changes, going this route seemed more sensible than
replicating the combines from DAGCombiner or adding patterns for
all-active masked loads/stores, but I'm happy pursuing either of these
approaches (or any other) if they are seen as more appropriate.1 parent 9c88b6d commit 6ac7c16
File tree
21 files changed
+204
-266
lines changed- clang/test/CodeGen/AArch64
- llvm
- lib/Target/AArch64
- test/CodeGen/AArch64
21 files changed
+204
-266
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5725 | 5725 | | |
5726 | 5726 | | |
5727 | 5727 | | |
5728 | | - | |
5729 | | - | |
| 5728 | + | |
| 5729 | + | |
5730 | 5730 | | |
5731 | 5731 | | |
5732 | 5732 | | |
| |||
25030 | 25030 | | |
25031 | 25031 | | |
25032 | 25032 | | |
25033 | | - | |
| 25033 | + | |
| 25034 | + | |
25034 | 25035 | | |
25035 | 25036 | | |
25036 | 25037 | | |
| |||
28568 | 28569 | | |
28569 | 28570 | | |
28570 | 28571 | | |
28571 | | - | |
| 28572 | + | |
28572 | 28573 | | |
28573 | 28574 | | |
28574 | 28575 | | |
| |||
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
| 211 | + | |
| 212 | + | |
218 | 213 | | |
219 | 214 | | |
220 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
335 | | - | |
| 334 | + | |
336 | 335 | | |
337 | 336 | | |
338 | 337 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
547 | | - | |
548 | 547 | | |
549 | 548 | | |
550 | 549 | | |
551 | | - | |
| 550 | + | |
552 | 551 | | |
553 | 552 | | |
554 | 553 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 12 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 26 | + | |
| 27 | + | |
31 | 28 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
35 | 32 | | |
36 | | - | |
| 33 | + | |
37 | 34 | | |
| 35 | + | |
38 | 36 | | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | | - | |
| 41 | + | |
43 | 42 | | |
44 | | - | |
| 43 | + | |
45 | 44 | | |
46 | | - | |
| 45 | + | |
47 | 46 | | |
48 | | - | |
| 47 | + | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
| |||
Lines changed: 6 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | | - | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
388 | 387 | | |
389 | 388 | | |
390 | 389 | | |
| |||
437 | 436 | | |
438 | 437 | | |
439 | 438 | | |
440 | | - | |
441 | | - | |
| 439 | + | |
442 | 440 | | |
443 | 441 | | |
444 | 442 | | |
| |||
0 commit comments