Skip to content

Commit a8f5309

Browse files
committed
[X86] combineConcatVectorOps - remove unnecessary vector type reconstruction. NFC.
ADD/SUB/MUL/AND/OR/XOR/ANDNP/FDIV/HADD/HSUB all have the same src/dst types
1 parent db8f6c0 commit a8f5309

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54672,12 +54672,9 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5467254672
case X86ISD::ANDNP:
5467354673
if (!IsSplat && ((VT.is256BitVector() && Subtarget.hasInt256()) ||
5467454674
(VT.is512BitVector() && Subtarget.useAVX512Regs()))) {
54675-
MVT SrcVT = Op0.getOperand(0).getSimpleValueType();
54676-
SrcVT = MVT::getVectorVT(SrcVT.getScalarType(),
54677-
NumOps * SrcVT.getVectorNumElements());
5467854675
return DAG.getNode(Op0.getOpcode(), DL, VT,
54679-
ConcatSubOperand(SrcVT, Ops, 0),
54680-
ConcatSubOperand(SrcVT, Ops, 1));
54676+
ConcatSubOperand(VT, Ops, 0),
54677+
ConcatSubOperand(VT, Ops, 1));
5468154678
}
5468254679
break;
5468354680
case X86ISD::PCMPEQ:
@@ -54718,25 +54715,19 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5471854715
if (!IsSplat && ((VT.is256BitVector() && Subtarget.hasInt256()) ||
5471954716
(VT.is512BitVector() && Subtarget.useAVX512Regs() &&
5472054717
(EltSizeInBits >= 32 || Subtarget.useBWIRegs())))) {
54721-
MVT SrcVT = Op0.getOperand(0).getSimpleValueType();
54722-
SrcVT = MVT::getVectorVT(SrcVT.getScalarType(),
54723-
NumOps * SrcVT.getVectorNumElements());
5472454718
return DAG.getNode(Op0.getOpcode(), DL, VT,
54725-
ConcatSubOperand(SrcVT, Ops, 0),
54726-
ConcatSubOperand(SrcVT, Ops, 1));
54719+
ConcatSubOperand(VT, Ops, 0),
54720+
ConcatSubOperand(VT, Ops, 1));
5472754721
}
5472854722
break;
5472954723
// Due to VADD, VSUB, VMUL can executed on more ports than VINSERT and
5473054724
// their latency are short, so here we don't replace them.
5473154725
case ISD::FDIV:
5473254726
if (!IsSplat && (VT.is256BitVector() ||
5473354727
(VT.is512BitVector() && Subtarget.useAVX512Regs()))) {
54734-
MVT SrcVT = Op0.getOperand(0).getSimpleValueType();
54735-
SrcVT = MVT::getVectorVT(SrcVT.getScalarType(),
54736-
NumOps * SrcVT.getVectorNumElements());
5473754728
return DAG.getNode(Op0.getOpcode(), DL, VT,
54738-
ConcatSubOperand(SrcVT, Ops, 0),
54739-
ConcatSubOperand(SrcVT, Ops, 1));
54729+
ConcatSubOperand(VT, Ops, 0),
54730+
ConcatSubOperand(VT, Ops, 1));
5474054731
}
5474154732
break;
5474254733
case X86ISD::HADD:
@@ -54745,12 +54736,9 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5474554736
case X86ISD::FHSUB:
5474654737
if (!IsSplat && VT.is256BitVector() &&
5474754738
(VT.isFloatingPoint() || Subtarget.hasInt256())) {
54748-
MVT SrcVT = Op0.getOperand(0).getSimpleValueType();
54749-
SrcVT = MVT::getVectorVT(SrcVT.getScalarType(),
54750-
NumOps * SrcVT.getVectorNumElements());
5475154739
return DAG.getNode(Op0.getOpcode(), DL, VT,
54752-
ConcatSubOperand(SrcVT, Ops, 0),
54753-
ConcatSubOperand(SrcVT, Ops, 1));
54740+
ConcatSubOperand(VT, Ops, 0),
54741+
ConcatSubOperand(VT, Ops, 1));
5475454742
}
5475554743
break;
5475654744
case X86ISD::PACKSS:

0 commit comments

Comments
 (0)