[llvm] [VectorCombine] New folding pattern for extract/binop/shuffle chains (PR #145232)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 22 22:35:22 PDT 2025
================
@@ -2910,6 +2911,133 @@ bool VectorCombine::foldShuffleFromReductions(Instruction &I) {
return foldSelectShuffle(*Shuffle, true);
}
+bool VectorCombine::foldShuffleChainsToReduce(Instruction &I) {
+ auto *SVI = dyn_cast<ShuffleVectorInst>(&I);
----------------
dtcxzyw wrote:
This transform should start with the root instruction `ExtractElementInst` instead of the first instruction `ShuffleVectorInst`, then visit binop/shufflevector instructions through the def-use chain. `CI->getNextNode()` is expensive and unreliable. You can imagine that there are many unrelated instructions inserted into the middle of this pattern...
https://github.com/llvm/llvm-project/pull/145232
More information about the llvm-commits
mailing list