@@ -51665,9 +51665,11 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
51665
51665
if (Op0.getOpcode() == X86ISD::VBROADCAST)
51666
51666
return DAG.getNode(Op0.getOpcode(), DL, VT, Op0.getOperand(0));
51667
51667
51668
- // If this scalar/subvector broadcast_load is inserted into both halves, use
51669
- // a larger broadcast_load. Update other uses to use an extracted subvector.
51670
- if (Op0.getOpcode() == X86ISD::VBROADCAST_LOAD ||
51668
+ // If this simple subvector or scalar/subvector broadcast_load is inserted
51669
+ // into both halves, use a larger broadcast_load. Update other uses to use
51670
+ // an extracted subvector.
51671
+ if (ISD::isNormalLoad(Op0.getNode()) ||
51672
+ Op0.getOpcode() == X86ISD::VBROADCAST_LOAD ||
51671
51673
Op0.getOpcode() == X86ISD::SUBV_BROADCAST_LOAD) {
51672
51674
auto *Mem = cast<MemSDNode>(Op0);
51673
51675
unsigned Opc = Op0.getOpcode() == X86ISD::VBROADCAST_LOAD
@@ -51682,24 +51684,6 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
51682
51684
}
51683
51685
}
51684
51686
51685
- // If this is a simple subvector load repeated across multiple lanes, then
51686
- // broadcast the load. Update other uses to use an extracted subvector.
51687
- if (auto *Ld = dyn_cast<LoadSDNode>(Op0)) {
51688
- if (Ld->isSimple() && !Ld->isNonTemporal() &&
51689
- Ld->getExtensionType() == ISD::NON_EXTLOAD) {
51690
- SDVTList Tys = DAG.getVTList(VT, MVT::Other);
51691
- SDValue Ops[] = {Ld->getChain(), Ld->getBasePtr()};
51692
- SDValue BcastLd =
51693
- DAG.getMemIntrinsicNode(X86ISD::SUBV_BROADCAST_LOAD, DL, Tys, Ops,
51694
- Ld->getMemoryVT(), Ld->getMemOperand());
51695
- DAG.ReplaceAllUsesOfValueWith(
51696
- Op0,
51697
- extractSubVector(BcastLd, 0, DAG, DL, Op0.getValueSizeInBits()));
51698
- DAG.ReplaceAllUsesOfValueWith(SDValue(Ld, 1), BcastLd.getValue(1));
51699
- return BcastLd;
51700
- }
51701
- }
51702
-
51703
51687
// concat_vectors(movddup(x),movddup(x)) -> broadcast(x)
51704
51688
if (Op0.getOpcode() == X86ISD::MOVDDUP && VT == MVT::v4f64 &&
51705
51689
(Subtarget.hasAVX2() ||
0 commit comments