@@ -7200,6 +7200,7 @@ static SDValue lowerBuildVectorAsBroadcast(BuildVectorSDNode *BVOp,
7200
7200
7201
7201
MVT VT = BVOp->getSimpleValueType(0);
7202
7202
unsigned NumElts = VT.getVectorNumElements();
7203
+ const TargetLowering &TLI = DAG.getTargetLoweringInfo();
7203
7204
assert((VT.is128BitVector() || VT.is256BitVector() || VT.is512BitVector()) &&
7204
7205
"Unsupported vector type for broadcast.");
7205
7206
@@ -7265,7 +7266,6 @@ static SDValue lowerBuildVectorAsBroadcast(BuildVectorSDNode *BVOp,
7265
7266
if (isFoldableUseOfShuffle(BVOp))
7266
7267
return SDValue();
7267
7268
// replace BUILD_VECTOR with broadcast of the repeated constants.
7268
- const TargetLowering &TLI = DAG.getTargetLoweringInfo();
7269
7269
LLVMContext *Ctx = DAG.getContext();
7270
7270
MVT PVT = TLI.getPointerTy(DAG.getDataLayout());
7271
7271
if (SplatBitSize == 32 || SplatBitSize == 64 ||
@@ -7363,7 +7363,6 @@ static SDValue lowerBuildVectorAsBroadcast(BuildVectorSDNode *BVOp,
7363
7363
7364
7364
assert(C && "Invalid constant type");
7365
7365
7366
- const TargetLowering &TLI = DAG.getTargetLoweringInfo();
7367
7366
SDValue CP =
7368
7367
DAG.getConstantPool(C, TLI.getPointerTy(DAG.getDataLayout()));
7369
7368
Align Alignment = cast<ConstantPoolSDNode>(CP)->getAlign();
@@ -38219,6 +38218,7 @@ static SDValue combineX86ShuffleChain(ArrayRef<SDValue> Inputs, SDValue Root,
38219
38218
38220
38219
unsigned NumMaskElts = Mask.size();
38221
38220
unsigned MaskEltSizeInBits = RootSizeInBits / NumMaskElts;
38221
+ const TargetLowering &TLI = DAG.getTargetLoweringInfo();
38222
38222
38223
38223
// Determine the effective mask value type.
38224
38224
FloatDomain &= (32 <= MaskEltSizeInBits);
@@ -38227,7 +38227,7 @@ static SDValue combineX86ShuffleChain(ArrayRef<SDValue> Inputs, SDValue Root,
38227
38227
MaskVT = MVT::getVectorVT(MaskVT, NumMaskElts);
38228
38228
38229
38229
// Only allow legal mask types.
38230
- if (!DAG.getTargetLoweringInfo() .isTypeLegal(MaskVT))
38230
+ if (!TLI .isTypeLegal(MaskVT))
38231
38231
return SDValue();
38232
38232
38233
38233
// Attempt to match the mask against known shuffle patterns.
@@ -38533,7 +38533,7 @@ static SDValue combineX86ShuffleChain(ArrayRef<SDValue> Inputs, SDValue Root,
38533
38533
// which is much simpler than any shuffle.
38534
38534
if (UnaryShuffle && MaskContainsZeros && AllowVariablePerLaneMask &&
38535
38535
isSequentialOrUndefOrZeroInRange(Mask, 0, NumMaskElts, 0) &&
38536
- DAG.getTargetLoweringInfo() .isTypeLegal(MaskVT)) {
38536
+ TLI .isTypeLegal(MaskVT)) {
38537
38537
APInt Zero = APInt::getZero(MaskEltSizeInBits);
38538
38538
APInt AllOnes = APInt::getAllOnes(MaskEltSizeInBits);
38539
38539
APInt UndefElts(NumMaskElts, 0);
@@ -40073,6 +40073,7 @@ static SDValue combineTargetShuffle(SDValue N, const SDLoc &DL,
40073
40073
MVT VT = N.getSimpleValueType();
40074
40074
SmallVector<int, 4> Mask;
40075
40075
unsigned Opcode = N.getOpcode();
40076
+ const TargetLowering &TLI = DAG.getTargetLoweringInfo();
40076
40077
40077
40078
if (SDValue R = combineCommutableSHUFP(N, VT, DL, DAG))
40078
40079
return R;
@@ -40124,7 +40125,7 @@ static SDValue combineTargetShuffle(SDValue N, const SDLoc &DL,
40124
40125
// 32-bit targets have to bitcast i64 to f64, so better to bitcast upward.
40125
40126
if (Src.getOpcode() == ISD::BITCAST &&
40126
40127
SrcVT.getScalarSizeInBits() == BCVT.getScalarSizeInBits() &&
40127
- DAG.getTargetLoweringInfo() .isTypeLegal(BCVT) &&
40128
+ TLI .isTypeLegal(BCVT) &&
40128
40129
FixedVectorType::isValidElementType(
40129
40130
BCVT.getScalarType().getTypeForEVT(*DAG.getContext()))) {
40130
40131
EVT NewVT = EVT::getVectorVT(*DAG.getContext(), BCVT.getScalarType(),
@@ -40162,8 +40163,7 @@ static SDValue combineTargetShuffle(SDValue N, const SDLoc &DL,
40162
40163
isNullConstant(Src.getOperand(1)) &&
40163
40164
Src.getValueType() ==
40164
40165
Src.getOperand(0).getValueType().getScalarType() &&
40165
- DAG.getTargetLoweringInfo().isTypeLegal(
40166
- Src.getOperand(0).getValueType()))
40166
+ TLI.isTypeLegal(Src.getOperand(0).getValueType()))
40167
40167
return DAG.getNode(X86ISD::VBROADCAST, DL, VT, Src.getOperand(0));
40168
40168
40169
40169
// Share broadcast with the longest vector and extract low subvector (free).
@@ -40377,7 +40377,7 @@ static SDValue combineTargetShuffle(SDValue N, const SDLoc &DL,
40377
40377
ConstantVec[0] = const_cast<ConstantInt *>(C->getConstantIntValue());
40378
40378
40379
40379
// Load the vector constant from constant pool.
40380
- MVT PVT = DAG.getTargetLoweringInfo() .getPointerTy(DAG.getDataLayout());
40380
+ MVT PVT = TLI .getPointerTy(DAG.getDataLayout());
40381
40381
SDValue CP = DAG.getConstantPool(ConstantVector::get(ConstantVec), PVT);
40382
40382
MachinePointerInfo MPI =
40383
40383
MachinePointerInfo::getConstantPool(DAG.getMachineFunction());
@@ -44555,7 +44555,6 @@ static SDValue combineExtractVectorElt(SDNode *N, SelectionDAG &DAG,
44555
44555
if (LoadVec && CIdx && ISD::isNormalLoad(LoadVec) && VT.isInteger() &&
44556
44556
SrcVT.getVectorElementType() == VT && DCI.isAfterLegalizeDAG() &&
44557
44557
!LikelyUsedAsVector && LoadVec->isSimple()) {
44558
- const TargetLowering &TLI = DAG.getTargetLoweringInfo();
44559
44558
SDValue NewPtr =
44560
44559
TLI.getVectorElementPointer(DAG, LoadVec->getBasePtr(), SrcVT, EltIdx);
44561
44560
unsigned PtrOff = VT.getSizeInBits() * CIdx->getZExtValue() / 8;
@@ -45957,6 +45956,7 @@ static SDValue combinePTESTCC(SDValue EFLAGS, X86::CondCode &CC,
45957
45956
SDValue Op0 = EFLAGS.getOperand(0);
45958
45957
SDValue Op1 = EFLAGS.getOperand(1);
45959
45958
MVT OpVT = Op0.getSimpleValueType();
45959
+ const TargetLowering &TLI = DAG.getTargetLoweringInfo();
45960
45960
45961
45961
// TEST*(~X,Y) == TEST*(X,Y)
45962
45962
if (SDValue NotOp0 = IsNOT(Op0, DAG)) {
@@ -46040,12 +46040,11 @@ static SDValue combinePTESTCC(SDValue EFLAGS, X86::CondCode &CC,
46040
46040
// TODO: Handle TESTC with comparison inversion.
46041
46041
// TODO: Can we remove SimplifyMultipleUseDemandedBits and rely on
46042
46042
// TESTP/MOVMSK combines to make sure its never worse than PTEST?
46043
- if (BCVT.isVector() && DAG.getTargetLoweringInfo() .isTypeLegal(BCVT)) {
46043
+ if (BCVT.isVector() && TLI .isTypeLegal(BCVT)) {
46044
46044
unsigned EltBits = BCVT.getScalarSizeInBits();
46045
46045
if (DAG.ComputeNumSignBits(BC) == EltBits) {
46046
46046
assert(VT == MVT::i32 && "Expected i32 EFLAGS comparison result");
46047
46047
APInt SignMask = APInt::getSignMask(EltBits);
46048
- const TargetLowering &TLI = DAG.getTargetLoweringInfo();
46049
46048
if (SDValue Res =
46050
46049
TLI.SimplifyMultipleUseDemandedBits(BC, SignMask, DAG)) {
46051
46050
// For vXi16 cases we need to use pmovmksb and extract every other
@@ -53605,6 +53604,7 @@ static SDValue combineGatherScatter(SDNode *N, SelectionDAG &DAG,
53605
53604
SDValue Index = GorS->getIndex();
53606
53605
SDValue Base = GorS->getBasePtr();
53607
53606
SDValue Scale = GorS->getScale();
53607
+ const TargetLowering &TLI = DAG.getTargetLoweringInfo();
53608
53608
53609
53609
if (DCI.isBeforeLegalize()) {
53610
53610
unsigned IndexWidth = Index.getScalarValueSizeInBits();
@@ -53639,7 +53639,6 @@ static SDValue combineGatherScatter(SDNode *N, SelectionDAG &DAG,
53639
53639
}
53640
53640
}
53641
53641
53642
- const TargetLowering &TLI = DAG.getTargetLoweringInfo();
53643
53642
EVT PtrVT = TLI.getPointerTy(DAG.getDataLayout());
53644
53643
// Try to move splat constant adders from the index operand to the base
53645
53644
// pointer operand. Taking care to multiply by the scale. We can only do
@@ -53696,7 +53695,6 @@ static SDValue combineGatherScatter(SDNode *N, SelectionDAG &DAG,
53696
53695
// With vector masks we only demand the upper bit of the mask.
53697
53696
SDValue Mask = GorS->getMask();
53698
53697
if (Mask.getScalarValueSizeInBits() != 1) {
53699
- const TargetLowering &TLI = DAG.getTargetLoweringInfo();
53700
53698
APInt DemandedMask(APInt::getSignMask(Mask.getScalarValueSizeInBits()));
53701
53699
if (TLI.SimplifyDemandedBits(Mask, DemandedMask, DCI)) {
53702
53700
if (N->getOpcode() != ISD::DELETED_NODE)
0 commit comments