Skip to content

Commit 44badc9

Browse files
authored
[X86] combineConcatVectorOps - use isSplatValue helper instead of matching specific VBROADCAST opcodes. (#129556)
1 parent a704e65 commit 44badc9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57798,19 +57798,18 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5779857798
Op0.getOperand(0).getValueType() == VT.getScalarType())
5779957799
return DAG.getNode(X86ISD::VBROADCAST, DL, VT, Op0.getOperand(0));
5780057800

57801-
// concat_vectors(extract_subvector(broadcast(x)),
57802-
// extract_subvector(broadcast(x))) -> broadcast(x)
57801+
// concat_vectors(extract_subvector(splat(x)),
57802+
// extract_subvector(splat(x))) -> splat(x)
5780357803
// concat_vectors(extract_subvector(subv_broadcast(x)),
5780457804
// extract_subvector(subv_broadcast(x))) -> subv_broadcast(x)
5780557805
if (Op0.getOpcode() == ISD::EXTRACT_SUBVECTOR &&
5780657806
Op0.getOperand(0).getValueType() == VT) {
5780757807
SDValue SrcVec = Op0.getOperand(0);
57808-
if (SrcVec.getOpcode() == X86ISD::VBROADCAST ||
57809-
SrcVec.getOpcode() == X86ISD::VBROADCAST_LOAD)
57810-
return Op0.getOperand(0);
57808+
if (DAG.isSplatValue(SrcVec, /*AllowUndefs*/ false))
57809+
return SrcVec;
5781157810
if (SrcVec.getOpcode() == X86ISD::SUBV_BROADCAST_LOAD &&
5781257811
Op0.getValueType() == cast<MemSDNode>(SrcVec)->getMemoryVT())
57813-
return Op0.getOperand(0);
57812+
return SrcVec;
5781457813
}
5781557814

5781657815
// concat_vectors(permq(x),permq(x)) -> permq(concat_vectors(x,x))

0 commit comments

Comments
 (0)