-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Closed
Closed
Copy link
Labels
good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributellvm::vectorcombineCost-based vector combine passCost-based vector combine passmissed-optimization
Description
The "shuffle (intrinsic), (intrinsic)" -> "intrinsic (shuffle), (shuffle)" fold is currently limited by a mOneUse check:
llvm-project/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
Lines 3076 to 3081 in ba55ef3
| bool VectorCombine::foldShuffleOfIntrinsics(Instruction &I) { | |
| Value *V0, *V1; | |
| ArrayRef<int> OldMask; | |
| if (!match(&I, m_Shuffle(m_OneUse(m_Value(V0)), m_OneUse(m_Value(V1)), | |
| m_Mask(OldMask)))) | |
| return false; |
We should try to remove the m_OneUse limits and adjust the NewCost accordingly - similar to what happens in foldShuffleOfCastops
A large portion of this task will be creating test coverage.
Metadata
Metadata
Assignees
Labels
good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributellvm::vectorcombineCost-based vector combine passCost-based vector combine passmissed-optimization