Skip to content

Commit 7ff2ce9

Browse files
committed
[X86] combineConcatVectorOps - pull out repeated DAG.getContext calls. NFC.
1 parent e1c0e7e commit 7ff2ce9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54483,6 +54483,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5448354483
bool IsSplat = llvm::all_equal(Ops);
5448454484
unsigned NumOps = Ops.size();
5448554485
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
54486+
LLVMContext &Ctx = *DAG.getContext();
5448654487

5448754488
// Repeated subvectors.
5448854489
if (IsSplat &&
@@ -54780,7 +54781,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5478054781
Subtarget.useAVX512Regs() &&
5478154782
Subtarget.getPreferVectorWidth() >= 512 &&
5478254783
(SrcVT.getScalarSizeInBits() > 16 || Subtarget.useBWIRegs())) {
54783-
EVT NewSrcVT = SrcVT.getDoubleNumVectorElementsVT(*DAG.getContext());
54784+
EVT NewSrcVT = SrcVT.getDoubleNumVectorElementsVT(Ctx);
5478454785
return DAG.getNode(ISD::TRUNCATE, DL, VT,
5478554786
ConcatSubOperand(NewSrcVT, Ops, 0));
5478654787
}
@@ -54937,7 +54938,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5493754938
(EltSizeInBits >= 32 || Subtarget.hasBWI())) {
5493854939
EVT SelVT = Ops[0].getOperand(0).getValueType();
5493954940
if (SelVT.getVectorElementType() == MVT::i1) {
54940-
SelVT = EVT::getVectorVT(*DAG.getContext(), MVT::i1,
54941+
SelVT = EVT::getVectorVT(Ctx, MVT::i1,
5494154942
NumOps * SelVT.getVectorNumElements());
5494254943
if (TLI.isTypeLegal(SelVT))
5494354944
return DAG.getNode(Op0.getOpcode(), DL, VT,
@@ -54952,7 +54953,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5495254953
(EltSizeInBits >= 32 || Subtarget.hasInt256()) &&
5495354954
IsConcatFree(VT, Ops, 1) && IsConcatFree(VT, Ops, 2)) {
5495454955
EVT SelVT = Ops[0].getOperand(0).getValueType();
54955-
SelVT = SelVT.getDoubleNumVectorElementsVT(*DAG.getContext());
54956+
SelVT = SelVT.getDoubleNumVectorElementsVT(Ctx);
5495654957
if (TLI.isTypeLegal(SelVT))
5495754958
return DAG.getNode(Op0.getOpcode(), DL, VT,
5495854959
ConcatSubOperand(SelVT.getSimpleVT(), Ops, 0),
@@ -54968,7 +54969,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5496854969
if (auto *FirstLd = dyn_cast<LoadSDNode>(peekThroughBitcasts(Op0))) {
5496954970
unsigned Fast;
5497054971
const X86TargetLowering *TLI = Subtarget.getTargetLowering();
54971-
if (TLI->allowsMemoryAccess(*DAG.getContext(), DAG.getDataLayout(), VT,
54972+
if (TLI->allowsMemoryAccess(Ctx, DAG.getDataLayout(), VT,
5497254973
*FirstLd->getMemOperand(), &Fast) &&
5497354974
Fast) {
5497454975
if (SDValue Ld =

0 commit comments

Comments
 (0)