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

Prep work before adding 512-bit support.
This commit is contained in:
Simon Pilgrim 2025-03-09 12:04:31 +00:00
parent 0f732481ac
commit 22a45c43db

View File

@ -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));
}