Commit adb6efe
authored
[SLP] Fix cost estimation of external uses with wrong VF (#148185)
It assumed that the VF remains constant throughout the tree. That's not
always true. This meant that we could query the extraction cost for a
lane that is out of bounds.
While experimenting with re-vectorisation for AArch64, we ran into this
issue. We cannot add a proper AArch64 test as more changes would need to
be brought in.
This commit is only fixing the computation of VF and adding an assert.
Some tests were failing after adding the assert:
- foo() in llvm/test/Transforms/SLPVectorizer/X86/horizontal.ll
- test() in
llvm/test/Transforms/SLPVectorizer/X86/reduction-with-removed-extracts.ll
- test_with_extract() in
llvm/test/Transforms/SLPVectorizer/RISCV/segmented-loads.ll1 parent 97d44e3 commit adb6efe
File tree
2 files changed
+42
-2
lines changed- llvm
- lib/Transforms/Vectorize
- test/Transforms/SLPVectorizer/RISCV
2 files changed
+42
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14560 | 14560 | | |
14561 | 14561 | | |
14562 | 14562 | | |
14563 | | - | |
14564 | | - | |
14565 | 14563 | | |
14566 | 14564 | | |
14567 | 14565 | | |
| |||
14624 | 14622 | | |
14625 | 14623 | | |
14626 | 14624 | | |
| 14625 | + | |
| 14626 | + | |
| 14627 | + | |
| 14628 | + | |
| 14629 | + | |
14627 | 14630 | | |
14628 | 14631 | | |
14629 | 14632 | | |
| |||
14731 | 14734 | | |
14732 | 14735 | | |
14733 | 14736 | | |
| 14737 | + | |
| 14738 | + | |
14734 | 14739 | | |
14735 | 14740 | | |
14736 | 14741 | | |
| |||
14744 | 14749 | | |
14745 | 14750 | | |
14746 | 14751 | | |
| 14752 | + | |
| 14753 | + | |
14747 | 14754 | | |
14748 | 14755 | | |
14749 | 14756 | | |
14750 | 14757 | | |
| 14758 | + | |
| 14759 | + | |
14751 | 14760 | | |
14752 | 14761 | | |
14753 | 14762 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
0 commit comments