Commit e39fef4
committed
[VPlan] Don't apply predication discount to non-originally-predicated blocks
Split off from llvm#158690. Currently if an instruction needs predicated due to tail folding, it will also have a predicated discount applied to it in multiple places.
This is likely inaccurate because we can expect a tail folded instruction to be executed on every iteration bar the last.
This fixes it by checking if the instruction/block was originally predicated, and in doing so prevents vectorization with tail folding where we would have had to scalarize the memory op anyway.1 parent 4f33d7b commit e39fef4
File tree
9 files changed
+78
-558
lines changed- llvm
- lib/Transforms/Vectorize
- test/Transforms/LoopVectorize
- AArch64
- ARM
- X86
- CostModel
9 files changed
+78
-558
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1249 | 1249 | | |
1250 | 1250 | | |
1251 | 1251 | | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
1252 | 1271 | | |
1253 | 1272 | | |
1254 | 1273 | | |
| |||
2902 | 2921 | | |
2903 | 2922 | | |
2904 | 2923 | | |
2905 | | - | |
| 2924 | + | |
| 2925 | + | |
2906 | 2926 | | |
2907 | 2927 | | |
2908 | 2928 | | |
| |||
5035 | 5055 | | |
5036 | 5056 | | |
5037 | 5057 | | |
5038 | | - | |
| 5058 | + | |
5039 | 5059 | | |
5040 | 5060 | | |
5041 | 5061 | | |
| |||
5088 | 5108 | | |
5089 | 5109 | | |
5090 | 5110 | | |
5091 | | - | |
| 5111 | + | |
5092 | 5112 | | |
5093 | 5113 | | |
5094 | 5114 | | |
| |||
5167 | 5187 | | |
5168 | 5188 | | |
5169 | 5189 | | |
5170 | | - | |
| 5190 | + | |
5171 | 5191 | | |
5172 | 5192 | | |
5173 | 5193 | | |
| |||
6727 | 6747 | | |
6728 | 6748 | | |
6729 | 6749 | | |
| 6750 | + | |
| 6751 | + | |
| 6752 | + | |
| 6753 | + | |
| 6754 | + | |
6730 | 6755 | | |
6731 | 6756 | | |
6732 | 6757 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
858 | | - | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
859 | 861 | | |
860 | 862 | | |
861 | 863 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | 53 | | |
69 | 54 | | |
70 | 55 | | |
| |||
364 | 349 | | |
365 | 350 | | |
366 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
367 | 356 | | |
368 | 357 | | |
369 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3170 | 3170 | | |
3171 | 3171 | | |
3172 | 3172 | | |
3173 | | - | |
| 3173 | + | |
3174 | 3174 | | |
3175 | 3175 | | |
3176 | 3176 | | |
| |||
Lines changed: 12 additions & 57 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
672 | 627 | | |
673 | 628 | | |
674 | 629 | | |
| |||
0 commit comments