[llvm] [WIP][VectorCombine] Fold "shuffle (binop (shuffle, shuffle)), undef" --> "binop (shuffle), (shuffle)" (PR #114101)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 29 13:47:33 PDT 2024
================
@@ -1400,6 +1401,92 @@ bool VectorCombine::scalarizeLoadExtract(Instruction &I) {
return true;
}
+/// Try to fold "shuffle (binop (shuffle, shuffle)), undef" into "binop (shuffle), (shuffle)".
+bool VectorCombine::foldPermuteOfBinops(Instruction &I) {
+ BinaryOperator *BinOp;
+ ArrayRef<int> OuterMask;
+ if (!match(&I,
+ m_Shuffle(m_OneUse(m_BinOp(BinOp)), m_Undef(), m_Mask(OuterMask))))
----------------
alexey-bataev wrote:
I think need to check that OuterMask operates on a `binop` only, does not permute with undef value
https://github.com/llvm/llvm-project/pull/114101
More information about the llvm-commits
mailing list