From e173631dd1f17f8f26ae84079bc059df2e633eb1 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 2 Nov 2021 13:07:36 +0000 Subject: [PATCH] [X86][AVX] SimplifyDemandedVectorEltsForTargetNode - use getBROADCAST_LOAD helper. NFCI. Reduce width of X86ISD::SUBV_BROADCAST_LOAD node. --- llvm/lib/Target/X86/X86ISelLowering.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 0f71dbda120f..26ea0d59a2f4 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -40122,15 +40122,11 @@ bool X86TargetLowering::SimplifyDemandedVectorEltsForTargetNode( SDLoc DL(Op); EVT BcstVT = EVT::getVectorVT(*TLO.DAG.getContext(), VT.getScalarType(), ExtSizeInBits / VT.getScalarSizeInBits()); - SDVTList Tys = TLO.DAG.getVTList(BcstVT, MVT::Other); - SDValue Ops[] = {MemIntr->getOperand(0), MemIntr->getOperand(1)}; - SDValue Bcst = - TLO.DAG.getMemIntrinsicNode(X86ISD::SUBV_BROADCAST_LOAD, DL, Tys, - Ops, MemVT, MemIntr->getMemOperand()); - TLO.DAG.makeEquivalentMemoryOrdering(SDValue(MemIntr, 1), - Bcst.getValue(1)); - return TLO.CombineTo(Op, insertSubVector(TLO.DAG.getUNDEF(VT), Bcst, 0, - TLO.DAG, DL, ExtSizeInBits)); + if (SDValue BcstLd = + getBROADCAST_LOAD(Opc, DL, BcstVT, MemVT, MemIntr, 0, TLO.DAG)) + return TLO.CombineTo(Op, + insertSubVector(TLO.DAG.getUNDEF(VT), BcstLd, 0, + TLO.DAG, DL, ExtSizeInBits)); } break; }