@@ -24433,6 +24433,7 @@ SDValue DAGCombiner::visitEXTRACT_SUBVECTOR(SDNode *N) {
24433
24433
EVT NVT = N->getValueType(0);
24434
24434
SDValue V = N->getOperand(0);
24435
24435
uint64_t ExtIdx = N->getConstantOperandVal(1);
24436
+ SDLoc DL(N);
24436
24437
24437
24438
// Extract from UNDEF is UNDEF.
24438
24439
if (V.isUndef())
@@ -24448,7 +24449,7 @@ SDValue DAGCombiner::visitEXTRACT_SUBVECTOR(SDNode *N) {
24448
24449
if (TLI.isExtractSubvectorCheap(NVT, V.getOperand(0).getValueType(),
24449
24450
V.getConstantOperandVal(1)) &&
24450
24451
TLI.isOperationLegalOrCustom(ISD::EXTRACT_SUBVECTOR, NVT)) {
24451
- return DAG.getNode(ISD::EXTRACT_SUBVECTOR, SDLoc(N) , NVT, V.getOperand(0),
24452
+ return DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL , NVT, V.getOperand(0),
24452
24453
V.getOperand(1));
24453
24454
}
24454
24455
}
@@ -24457,7 +24458,7 @@ SDValue DAGCombiner::visitEXTRACT_SUBVECTOR(SDNode *N) {
24457
24458
if (V.getOpcode() == ISD::SPLAT_VECTOR)
24458
24459
if (DAG.isConstantValueOfAnyType(V.getOperand(0)) || V.hasOneUse())
24459
24460
if (!LegalOperations || TLI.isOperationLegal(ISD::SPLAT_VECTOR, NVT))
24460
- return DAG.getSplatVector(NVT, SDLoc(N) , V.getOperand(0));
24461
+ return DAG.getSplatVector(NVT, DL , V.getOperand(0));
24461
24462
24462
24463
// Try to move vector bitcast after extract_subv by scaling extraction index:
24463
24464
// extract_subv (bitcast X), Index --> bitcast (extract_subv X, Index')
@@ -24471,10 +24472,9 @@ SDValue DAGCombiner::visitEXTRACT_SUBVECTOR(SDNode *N) {
24471
24472
if ((SrcNumElts % DestNumElts) == 0) {
24472
24473
unsigned SrcDestRatio = SrcNumElts / DestNumElts;
24473
24474
ElementCount NewExtEC = NVT.getVectorElementCount() * SrcDestRatio;
24474
- EVT NewExtVT = EVT::getVectorVT(*DAG.getContext(), SrcVT.getScalarType(),
24475
- NewExtEC);
24475
+ EVT NewExtVT =
24476
+ EVT::getVectorVT(*DAG.getContext(), SrcVT.getScalarType(), NewExtEC);
24476
24477
if (TLI.isOperationLegalOrCustom(ISD::EXTRACT_SUBVECTOR, NewExtVT)) {
24477
- SDLoc DL(N);
24478
24478
SDValue NewIndex = DAG.getVectorIdxConstant(ExtIdx * SrcDestRatio, DL);
24479
24479
SDValue NewExtract = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, NewExtVT,
24480
24480
V.getOperand(0), NewIndex);
@@ -24488,7 +24488,6 @@ SDValue DAGCombiner::visitEXTRACT_SUBVECTOR(SDNode *N) {
24488
24488
NVT.getVectorElementCount().divideCoefficientBy(DestSrcRatio);
24489
24489
EVT ScalarVT = SrcVT.getScalarType();
24490
24490
if ((ExtIdx % DestSrcRatio) == 0) {
24491
- SDLoc DL(N);
24492
24491
unsigned IndexValScaled = ExtIdx / DestSrcRatio;
24493
24492
EVT NewExtVT =
24494
24493
EVT::getVectorVT(*DAG.getContext(), ScalarVT, NewExtEC);
@@ -24536,7 +24535,6 @@ SDValue DAGCombiner::visitEXTRACT_SUBVECTOR(SDNode *N) {
24536
24535
// v2i8 extract_subvec v8i8 Y, 6
24537
24536
if (NVT.isFixedLengthVector() && ConcatSrcVT.isFixedLengthVector() &&
24538
24537
ConcatSrcNumElts % ExtNumElts == 0) {
24539
- SDLoc DL(N);
24540
24538
unsigned NewExtIdx = ExtIdx - ConcatOpIdx * ConcatSrcNumElts;
24541
24539
assert(NewExtIdx + ExtNumElts <= ConcatSrcNumElts &&
24542
24540
"Trying to extract from >1 concat operand?");
@@ -24575,13 +24573,13 @@ SDValue DAGCombiner::visitEXTRACT_SUBVECTOR(SDNode *N) {
24575
24573
if (NumElems == 1) {
24576
24574
SDValue Src = V->getOperand(IdxVal);
24577
24575
if (EltVT != Src.getValueType())
24578
- Src = DAG.getNode(ISD::TRUNCATE, SDLoc(N) , EltVT, Src);
24576
+ Src = DAG.getNode(ISD::TRUNCATE, DL , EltVT, Src);
24579
24577
return DAG.getBitcast(NVT, Src);
24580
24578
}
24581
24579
24582
24580
// Extract the pieces from the original build_vector.
24583
- SDValue BuildVec = DAG.getBuildVector(ExtractVT, SDLoc(N),
24584
- V->ops().slice(IdxVal, NumElems));
24581
+ SDValue BuildVec =
24582
+ DAG.getBuildVector(ExtractVT, DL, V->ops().slice(IdxVal, NumElems));
24585
24583
return DAG.getBitcast(NVT, BuildVec);
24586
24584
}
24587
24585
}
@@ -24608,7 +24606,7 @@ SDValue DAGCombiner::visitEXTRACT_SUBVECTOR(SDNode *N) {
24608
24606
return DAG.getBitcast(NVT, V.getOperand(1));
24609
24607
}
24610
24608
return DAG.getNode(
24611
- ISD::EXTRACT_SUBVECTOR, SDLoc(N) , NVT,
24609
+ ISD::EXTRACT_SUBVECTOR, DL , NVT,
24612
24610
DAG.getBitcast(N->getOperand(0).getValueType(), V.getOperand(0)),
24613
24611
N->getOperand(1));
24614
24612
}
0 commit comments