Commit 0ee8f69
authored
[VectorCombine] Fix invalid shuffle cost argument of foldShuffleOfSelects (llvm#130281)
In the previous code (llvm#128032), it specified the destination vector as the
getShuffleCost argument. Because the shuffle mask specifies the indices
of the two vectors specified as elements, the maximum value is twice the
size of the source vector. This causes a problem if the destination
vector is smaller than the source vector and specify an index in the
mask that exceeds the size of the destination vector.
Fix the problem by correcting the previous code, which was using wrong
argument in the Cost calculation.
Fixes llvm#1302501 parent 3ed4daf commit 0ee8f69
File tree
4 files changed
+359
-168
lines changed- llvm
- lib/Transforms/Vectorize
- test/Transforms
- PhaseOrdering/X86
- VectorCombine
- AArch64
- X86
4 files changed
+359
-168
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2037 | 2037 | | |
2038 | 2038 | | |
2039 | 2039 | | |
2040 | | - | |
2041 | 2040 | | |
2042 | 2041 | | |
2043 | 2042 | | |
| |||
2051 | 2050 | | |
2052 | 2051 | | |
2053 | 2052 | | |
| 2053 | + | |
| 2054 | + | |
2054 | 2055 | | |
2055 | 2056 | | |
2056 | 2057 | | |
2057 | | - | |
2058 | | - | |
| 2058 | + | |
| 2059 | + | |
2059 | 2060 | | |
2060 | | - | |
| 2061 | + | |
2061 | 2062 | | |
2062 | 2063 | | |
2063 | | - | |
2064 | | - | |
2065 | 2064 | | |
2066 | | - | |
| 2065 | + | |
2067 | 2066 | | |
2068 | | - | |
| 2067 | + | |
2069 | 2068 | | |
2070 | | - | |
2071 | | - | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
2072 | 2073 | | |
2073 | 2074 | | |
2074 | 2075 | | |
| |||
0 commit comments