[llvm] [X86] Fold VPERMV3(WIDEN(X),M,WIDEN(Y)) -> VPERMV(CONCAT(X,Y),M') iff the CONCAT is free (PR #122750)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 02:12:47 PST 2025


================
@@ -42436,6 +42437,24 @@ static SDValue combineTargetShuffle(SDValue N, const SDLoc &DL,
                                          /*IsMask=*/true);
         return DAG.getNode(X86ISD::VPERMV, DL, VT, NewMask, N.getOperand(0));
       }
+      // If sources are half width, then concat and use VPERMV with adjusted
+      // mask.
----------------
RKSimon wrote:

combineConcatVectorOps only combines the ops if it results in further concatenated combines (sequential loads/broadcasts, subvector/shuffle simplifications, concatenation of additional instructions etc.) - it never just returns a CONCAT_VECTORS node, as that is likely to break apart again in later folds.

https://github.com/llvm/llvm-project/pull/122750


More information about the llvm-commits mailing list