[llvm] 22a45c4 - [X86] combineConcatVectorOps - use all_of to check for matching PSHUFD/PSHUFLW/PSHUFHW shuffle mask.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 9 05:04:50 PDT 2025


Author: Simon Pilgrim
Date: 2025-03-09T12:04:39Z
New Revision: 22a45c43db2e6267d0b85a175da0129e865cffec

URL: https://github.com/llvm/llvm-project/commit/22a45c43db2e6267d0b85a175da0129e865cffec
DIFF: https://github.com/llvm/llvm-project/commit/22a45c43db2e6267d0b85a175da0129e865cffec.diff

LOG: [X86] combineConcatVectorOps - use all_of to check for matching PSHUFD/PSHUFLW/PSHUFHW shuffle mask.

Prep work before adding 512-bit support.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 1992ef67164d8..5d996b9360021 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -58044,7 +58044,9 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
     case X86ISD::PSHUFLW:
     case X86ISD::PSHUFD:
       if (!IsSplat && NumOps == 2 && VT.is256BitVector() &&
-          Subtarget.hasInt256() && Op0.getOperand(1) == Ops[1].getOperand(1)) {
+          Subtarget.hasInt256() && llvm::all_of(Ops, [Op0](SDValue Op) {
+            return Op.getOperand(1) == Op0.getOperand(1);
+          })) {
         return DAG.getNode(Op0.getOpcode(), DL, VT,
                            ConcatSubOperand(VT, Ops, 0), Op0.getOperand(1));
       }


        


More information about the llvm-commits mailing list