Skip to content

Commit 1d27669

Browse files
committed
[X86] combineConcatVectorOps - fold 512-bit concat(blendi(x,y,c0),blendi(z,w,c1)) to AVX512BW mask select
Yet another yak shaving regression fix for #73509
1 parent 0408a85 commit 1d27669

File tree

2 files changed

+281
-125
lines changed

2 files changed

+281
-125
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55015,6 +55015,19 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5501555015
ConcatSubOperand(VT, Ops, 1), Op0.getOperand(2));
5501655016
}
5501755017
break;
55018+
case X86ISD::BLENDI:
55019+
if (NumOps == 2 && VT.is512BitVector() && Subtarget.useBWIRegs()) {
55020+
uint64_t Mask0 = Ops[0].getConstantOperandVal(2);
55021+
uint64_t Mask1 = Ops[1].getConstantOperandVal(2);
55022+
uint64_t Mask = (Mask1 << (VT.getVectorNumElements() / 2)) | Mask0;
55023+
MVT MaskSVT = MVT::getIntegerVT(VT.getVectorNumElements());
55024+
MVT MaskVT = MVT::getVectorVT(MVT::i1, VT.getVectorNumElements());
55025+
SDValue Sel =
55026+
DAG.getBitcast(MaskVT, DAG.getConstant(Mask, DL, MaskSVT));
55027+
return DAG.getSelect(DL, VT, Sel, ConcatSubOperand(VT, Ops, 1),
55028+
ConcatSubOperand(VT, Ops, 0));
55029+
}
55030+
break;
5501855031
case ISD::VSELECT:
5501955032
if (!IsSplat && Subtarget.hasAVX512() &&
5502055033
(VT.is256BitVector() ||

0 commit comments

Comments
 (0)