Need to add NumSrcElts param to is..Mask functions in
ShuffleVectorInstruction class for better mask analysis. Mask.size() not
always matches the sizes of the permuted vector(s). Allows to better
estimate the cost in SLP and fix uses of the functions in other cases.
Details
Details
- Reviewers
RKSimon
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Time | Test | |
---|---|---|
430 ms | Linux x64 > LLVM.Transforms/SLPVectorizer/X86::blending-shuffle-inseltpoison.ll Exit Code: 2
Command Output (stderr):
| |
420 ms | Linux x64 > LLVM.Transforms/SLPVectorizer/X86::blending-shuffle.ll Exit Code: 2
Command Output (stderr):
| |
430 ms | Linux x64 > LLVM.Transforms/SLPVectorizer/X86::hadd-inseltpoison.ll Exit Code: 2
Command Output (stderr):
| |
440 ms | Linux x64 > LLVM.Transforms/SLPVectorizer/X86::hadd.ll Exit Code: 2
Command Output (stderr):
| |
420 ms | Linux x64 > LLVM.Transforms/SLPVectorizer/X86::hsub-inseltpoison.ll Exit Code: 2
Command Output (stderr):
| |
View Full Test Results (16 Failed) |
Event Timeline
llvm/lib/IR/Instructions.cpp | ||
---|---|---|
2178–2179 | If Mask.size() == 4 and NumSrcElts == 6. Then this considers <5, 4, 3, 2> as a reverse? |
llvm/lib/IR/Instructions.cpp | ||
---|---|---|
2178–2179 | Yes. Need to add a check that the operation does not change the size, just like non-static isReverse() does. |
llvm/lib/IR/Instructions.cpp | ||
---|---|---|
2158 | Why is the argument an int if we're going to cast it to unsigned? |
llvm/lib/IR/Instructions.cpp | ||
---|---|---|
2158 | For conformance. All other functions have corresponding int parameter, though treat it as unsigned. |
Comment Actions
No objections to this, but I do think it'd make sense to split into 2 patches - (1) adding the NumSrcElts argument to the shuffle matching helpers + additional unit test coverage and (2) using it in SLP
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
6658 | Maybe split this into a series of separate if () { return true/false; } to make it easier to grok? |
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
6658 | Done |