Skip to content

Commit eec697b

Browse files
authored
[X86] combineINSERT_SUBVECTOR - use getBROADCAST_LOAD helper in insert_subvector(undef, broadcast(p), hi) -> broadcast(p) fold (#128900)
1 parent bae4112 commit eec697b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58555,14 +58555,8 @@ static SDValue combineINSERT_SUBVECTOR(SDNode *N, SelectionDAG &DAG,
5855558555
if (Vec.isUndef() && IdxVal != 0 && SubVec.hasOneUse() &&
5855658556
SubVec.getOpcode() == X86ISD::VBROADCAST_LOAD) {
5855758557
auto *MemIntr = cast<MemIntrinsicSDNode>(SubVec);
58558-
SDVTList Tys = DAG.getVTList(OpVT, MVT::Other);
58559-
SDValue Ops[] = { MemIntr->getChain(), MemIntr->getBasePtr() };
58560-
SDValue BcastLd =
58561-
DAG.getMemIntrinsicNode(X86ISD::VBROADCAST_LOAD, dl, Tys, Ops,
58562-
MemIntr->getMemoryVT(),
58563-
MemIntr->getMemOperand());
58564-
DAG.ReplaceAllUsesOfValueWith(SDValue(MemIntr, 1), BcastLd.getValue(1));
58565-
return BcastLd;
58558+
return getBROADCAST_LOAD(X86ISD::VBROADCAST_LOAD, dl, OpVT,
58559+
MemIntr->getMemoryVT(), MemIntr, 0, DAG);
5856658560
}
5856758561

5856858562
// If we're splatting the lower half subvector of a full vector load into the

0 commit comments

Comments
 (0)