Skip to content

Commit 89e30dd

Browse files
committed
Switch to unsigned index proposal
1 parent e9199c9 commit 89e30dd

File tree

3 files changed

+51
-49
lines changed

3 files changed

+51
-49
lines changed

llvm/include/llvm/CodeGen/SelectionDAG.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -924,16 +924,18 @@ class SelectionDAG {
924924
/// Example: shuffle A, B, <0,5,2,7> -> shuffle B, A, <4,1,6,3>
925925
SDValue getCommutedVectorShuffle(const ShuffleVectorSDNode &SV);
926926

927-
/// Insert SubVec into the lowest sub-vector of Vec.
928-
SDValue getInsertLowSubvector(const SDLoc &DL, SDValue Vec, SDValue SubVec) {
927+
/// Insert \p SubVec into the \p Idx sub-vector of \p Vec.
928+
SDValue getInsertSubvector(const SDLoc &DL, SDValue Vec, SDValue SubVec,
929+
unsigned Idx) {
929930
return getNode(ISD::INSERT_SUBVECTOR, DL, Vec.getValueType(), Vec, SubVec,
930-
getVectorIdxConstant(0, DL));
931+
getVectorIdxConstant(Idx, DL));
931932
}
932933

933-
/// Return the lowest VT typed sub-vector of Vec.
934-
SDValue getExtractLowSubvector(const SDLoc &DL, EVT VT, SDValue Vec) {
934+
/// Return the \p VT typed sub-vector of \p Vec at \p Idx
935+
SDValue getExtractSubvector(const SDLoc &DL, EVT VT, SDValue Vec,
936+
unsigned Idx) {
935937
return getNode(ISD::EXTRACT_SUBVECTOR, DL, VT, Vec,
936-
getVectorIdxConstant(0, DL));
938+
getVectorIdxConstant(Idx, DL));
937939
}
938940

939941
/// Convert Op, which must be of float type, to the

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12671,7 +12671,7 @@ SelectionDAG::matchBinOpReduction(SDNode *Extract, ISD::NodeType &BinOp,
1267112671
if (!TLI->isExtractSubvectorCheap(SubVT, OpVT, 0))
1267212672
return SDValue();
1267312673
BinOp = (ISD::NodeType)CandidateBinOp;
12674-
return getExtractLowSubvector(SDLoc(Op), SubVT, Op);
12674+
return getExtractSubvector(SDLoc(Op), SubVT, Op, 0);
1267512675
};
1267612676

1267712677
// At each stage, we're looking for something that looks like:
@@ -13041,7 +13041,7 @@ SelectionDAG::SplitVector(const SDValue &N, const SDLoc &DL, const EVT &LoVT,
1304113041
N.getValueType().getVectorMinNumElements() &&
1304213042
"More vector elements requested than available!");
1304313043
SDValue Lo, Hi;
13044-
Lo = getExtractLowSubvector(DL, LoVT, N);
13044+
Lo = getExtractSubvector(DL, LoVT, N, 0);
1304513045
// For scalable vectors it is safe to use LoVT.getVectorMinNumElements()
1304613046
// (rather than having to use ElementCount), because EXTRACT_SUBVECTOR scales
1304713047
// IDX with the runtime scaling factor of the result vector type. For
@@ -13073,7 +13073,7 @@ SDValue SelectionDAG::WidenVector(const SDValue &N, const SDLoc &DL) {
1307313073
EVT VT = N.getValueType();
1307413074
EVT WideVT = EVT::getVectorVT(*getContext(), VT.getVectorElementType(),
1307513075
NextPowerOf2(VT.getVectorNumElements()));
13076-
return getInsertLowSubvector(DL, getUNDEF(WideVT), N);
13076+
return getInsertSubvector(DL, getUNDEF(WideVT), N, 0);
1307713077
}
1307813078

1307913079
void SelectionDAG::ExtractVectorElements(SDValue Op,

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2780,7 +2780,7 @@ static SDValue convertToScalableVector(EVT VT, SDValue V, SelectionDAG &DAG,
27802780
assert(V.getValueType().isFixedLengthVector() &&
27812781
"Expected a fixed length vector operand!");
27822782
SDLoc DL(V);
2783-
return DAG.getInsertLowSubvector(DL, DAG.getUNDEF(VT), V);
2783+
return DAG.getInsertSubvector(DL, DAG.getUNDEF(VT), V, 0);
27842784
}
27852785

27862786
// Shrink V so it's just big enough to maintain a VT's worth of data.
@@ -3624,9 +3624,9 @@ static SDValue matchSplatAsGather(SDValue SplatVal, MVT VT, const SDLoc &DL,
36243624
// Put Vec in a VT sized vector
36253625
if (SrcContainerVT.getVectorMinNumElements() <
36263626
ContainerVT.getVectorMinNumElements())
3627-
Src = DAG.getInsertLowSubvector(DL, DAG.getUNDEF(ContainerVT), Src);
3627+
Src = DAG.getInsertSubvector(DL, DAG.getUNDEF(ContainerVT), Src, 0);
36283628
else
3629-
Src = DAG.getExtractLowSubvector(DL, ContainerVT, Src);
3629+
Src = DAG.getExtractSubvector(DL, ContainerVT, Src, 0);
36303630

36313631
// We checked that Idx fits inside VT earlier
36323632
auto [Mask, VL] = getDefaultVLOps(VT, ContainerVT, DL, DAG, Subtarget);
@@ -4551,8 +4551,8 @@ static SDValue lowerScalarInsert(SDValue Scalar, SDValue VL, MVT VT,
45514551
ExtractedVal, DAG, Subtarget);
45524552
}
45534553
if (ExtractedContainerVT.bitsLE(VT))
4554-
return DAG.getInsertLowSubvector(DL, Passthru, ExtractedVal);
4555-
return DAG.getExtractLowSubvector(DL, VT, ExtractedVal);
4554+
return DAG.getInsertSubvector(DL, Passthru, ExtractedVal, 0);
4555+
return DAG.getExtractSubvector(DL, VT, ExtractedVal, 0);
45564556
}
45574557
}
45584558

@@ -4757,7 +4757,7 @@ static SDValue getDeinterleaveShiftAndTrunc(const SDLoc &DL, MVT VT,
47574757
Res = DAG.getNode(ISD::TRUNCATE, DL, ResVT, Res);
47584758
MVT CastVT = ResVT.changeVectorElementType(VT.getVectorElementType());
47594759
Res = DAG.getBitcast(CastVT, Res);
4760-
return DAG.getInsertLowSubvector(DL, DAG.getUNDEF(VT), Res);
4760+
return DAG.getInsertSubvector(DL, DAG.getUNDEF(VT), Res, 0);
47614761
}
47624762

47634763
/// Match a single source shuffle which is an identity except that some
@@ -5217,7 +5217,7 @@ static SDValue lowerBitreverseShuffle(ShuffleVectorSDNode *SVN,
52175217
// to insert it into the larger vector and then shift up the reversed bits
52185218
// afterwards to get rid of the gap introduced.
52195219
if (ViaEltSize > NumElts)
5220-
V = DAG.getInsertLowSubvector(DL, DAG.getUNDEF(ViaBitVT), V);
5220+
V = DAG.getInsertSubvector(DL, DAG.getUNDEF(ViaBitVT), V, 0);
52215221

52225222
SDValue Res =
52235223
DAG.getNode(ISD::BITREVERSE, DL, ViaVT, DAG.getBitcast(ViaVT, V));
@@ -5231,7 +5231,7 @@ static SDValue lowerBitreverseShuffle(ShuffleVectorSDNode *SVN,
52315231
Res = DAG.getBitcast(ViaBitVT, Res);
52325232

52335233
if (ViaEltSize > NumElts)
5234-
Res = DAG.getExtractLowSubvector(DL, VT, Res);
5234+
Res = DAG.getExtractSubvector(DL, VT, Res, 0);
52355235
return Res;
52365236
}
52375237

@@ -5751,7 +5751,7 @@ static SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG,
57515751
return Concat;
57525752

57535753
SDValue Vec = DAG.getUNDEF(VT);
5754-
return DAG.getInsertLowSubvector(DL, Vec, Concat);
5754+
return DAG.getInsertSubvector(DL, Vec, Concat, 0);
57555755
}
57565756
}
57575757
}
@@ -5800,8 +5800,8 @@ static SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG,
58005800
// Prefer vzip2a if available.
58015801
// TODO: Extend to matching zip2b if EvenSrc and OddSrc allow.
58025802
if (Subtarget.hasVendorXRivosVizip()) {
5803-
EvenV = DAG.getInsertLowSubvector(DL, DAG.getUNDEF(VT), EvenV);
5804-
OddV = DAG.getInsertLowSubvector(DL, DAG.getUNDEF(VT), OddV);
5803+
EvenV = DAG.getInsertSubvector(DL, DAG.getUNDEF(VT), EvenV, 0);
5804+
OddV = DAG.getInsertSubvector(DL, DAG.getUNDEF(VT), OddV, 0);
58055805
return lowerVZIP(RISCVISD::RI_VZIP2A_VL, EvenV, OddV, DL, DAG, Subtarget);
58065806
}
58075807
return getWideningInterleave(EvenV, OddV, DL, DAG, Subtarget);
@@ -5936,7 +5936,7 @@ static SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG,
59365936
if (isSpreadMask(Mask, Factor, Index)) {
59375937
MVT NarrowVT =
59385938
MVT::getVectorVT(VT.getVectorElementType(), NumElts / Factor);
5939-
SDValue Src = DAG.getExtractLowSubvector(DL, NarrowVT, V1);
5939+
SDValue Src = DAG.getExtractSubvector(DL, NarrowVT, V1, 0);
59405940
return getWideningSpread(Src, Factor, Index, DL, DAG);
59415941
}
59425942
}
@@ -5957,10 +5957,10 @@ static SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG,
59575957
std::max((uint64_t)MinVLMAX, PowerOf2Ceil(MaxIdx + 1));
59585958
if (NewNumElts != NumElts) {
59595959
MVT NewVT = MVT::getVectorVT(VT.getVectorElementType(), NewNumElts);
5960-
V1 = DAG.getExtractLowSubvector(DL, NewVT, V1);
5960+
V1 = DAG.getExtractSubvector(DL, NewVT, V1, 0);
59615961
SDValue Res = DAG.getVectorShuffle(NewVT, DL, V1, DAG.getUNDEF(NewVT),
59625962
Mask.take_front(NewNumElts));
5963-
return DAG.getInsertLowSubvector(DL, DAG.getUNDEF(VT), Res);
5963+
return DAG.getInsertSubvector(DL, DAG.getUNDEF(VT), Res, 0);
59645964
}
59655965
}
59665966

@@ -6040,7 +6040,7 @@ static SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG,
60406040
// source register group. TODO: This generalizes to m2, and m4.
60416041
const MVT M1VT = getLMUL1VT(ContainerVT);
60426042
EVT SubIndexVT = M1VT.changeVectorElementType(IndexVT.getScalarType());
6043-
SDValue SubIndex = DAG.getExtractLowSubvector(DL, SubIndexVT, LHSIndices);
6043+
SDValue SubIndex = DAG.getExtractSubvector(DL, SubIndexVT, LHSIndices, 0);
60446044
auto [InnerTrueMask, InnerVL] =
60456045
getDefaultScalableVLOps(M1VT, DL, DAG, Subtarget);
60466046
int N = ContainerVT.getVectorMinNumElements() /
@@ -6073,8 +6073,8 @@ static SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG,
60736073
int N = ContainerVT.getVectorMinNumElements() /
60746074
M1VT.getVectorMinNumElements();
60756075
assert(isPowerOf2_32(N) && N <= 8);
6076-
SDValue SubV1 = DAG.getExtractLowSubvector(DL, M1VT, V1);
6077-
SDValue SubIndex = DAG.getExtractLowSubvector(DL, SubIndexVT, LHSIndices);
6076+
SDValue SubV1 = DAG.getExtractSubvector(DL, M1VT, V1, 0);
6077+
SDValue SubIndex = DAG.getExtractSubvector(DL, SubIndexVT, LHSIndices, 0);
60786078
SDValue SubVec = DAG.getNode(GatherVVOpc, DL, M1VT, SubV1, SubIndex,
60796079
DAG.getUNDEF(M1VT), InnerTrueMask, InnerVL);
60806080
Gather = DAG.getUNDEF(ContainerVT);
@@ -6100,14 +6100,14 @@ static SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG,
61006100
Gather = DAG.getUNDEF(ContainerVT);
61016101
SDValue SlideAmt =
61026102
DAG.getElementCount(DL, XLenVT, M1VT.getVectorElementCount());
6103-
SDValue SubV1 = DAG.getExtractLowSubvector(DL, M1VT, V1);
6103+
SDValue SubV1 = DAG.getExtractSubvector(DL, M1VT, V1, 0);
61046104
for (int i = 0; i < N; i++) {
61056105
if (i != 0)
61066106
LHSIndices = getVSlidedown(DAG, Subtarget, DL, IndexContainerVT,
61076107
DAG.getUNDEF(IndexContainerVT), LHSIndices,
61086108
SlideAmt, TrueMask, VL);
61096109
SDValue SubIndex =
6110-
DAG.getExtractLowSubvector(DL, SubIndexVT, LHSIndices);
6110+
DAG.getExtractSubvector(DL, SubIndexVT, LHSIndices, 0);
61116111
SDValue SubVec =
61126112
DAG.getNode(GatherVVOpc, DL, M1VT, SubV1, SubIndex,
61136113
DAG.getUNDEF(M1VT), InnerTrueMask, InnerVL);
@@ -9875,7 +9875,7 @@ SDValue RISCVTargetLowering::lowerEXTRACT_VECTOR_ELT(SDValue Op,
98759875
if (auto SmallerVT =
98769876
getSmallestVTForIndex(ContainerVT, *MaxIdx, DL, DAG, Subtarget)) {
98779877
ContainerVT = *SmallerVT;
9878-
Vec = DAG.getExtractLowSubvector(DL, ContainerVT, Vec);
9878+
Vec = DAG.getExtractSubvector(DL, ContainerVT, Vec, 0);
98799879
}
98809880
}
98819881

@@ -10822,7 +10822,7 @@ static SDValue lowerReductionSeq(unsigned RVVOpcode, MVT ResVT,
1082210822
lowerScalarInsert(StartValue, InnerVL, InnerVT, DL, DAG, Subtarget);
1082310823
if (M1VT != InnerVT)
1082410824
InitialValue =
10825-
DAG.getInsertLowSubvector(DL, DAG.getUNDEF(M1VT), InitialValue);
10825+
DAG.getInsertSubvector(DL, DAG.getUNDEF(M1VT), InitialValue, 0);
1082610826
SDValue PassThru = NonZeroAVL ? DAG.getUNDEF(M1VT) : InitialValue;
1082710827
SDValue Policy = DAG.getTargetConstant(RISCVVType::TAIL_AGNOSTIC, DL, XLenVT);
1082810828
SDValue Ops[] = {PassThru, Vec, InitialValue, Mask, VL, Policy};
@@ -11072,7 +11072,7 @@ SDValue RISCVTargetLowering::lowerINSERT_SUBVECTOR(SDValue Op,
1107211072
Vec = convertToScalableVector(ContainerVT, Vec, DAG, Subtarget);
1107311073
}
1107411074

11075-
SubVec = DAG.getInsertLowSubvector(DL, DAG.getUNDEF(ContainerVT), SubVec);
11075+
SubVec = DAG.getInsertSubvector(DL, DAG.getUNDEF(ContainerVT), SubVec, 0);
1107611076

1107711077
SDValue Mask =
1107811078
getDefaultVLOps(VecVT, ContainerVT, DL, DAG, Subtarget).first;
@@ -11198,7 +11198,7 @@ SDValue RISCVTargetLowering::lowerINSERT_SUBVECTOR(SDValue Op,
1119811198
DAG.getVectorIdxConstant(AlignedIdx, DL));
1119911199
}
1120011200

11201-
SubVec = DAG.getInsertLowSubvector(DL, DAG.getUNDEF(InterSubVT), SubVec);
11201+
SubVec = DAG.getInsertSubvector(DL, DAG.getUNDEF(InterSubVT), SubVec, 0);
1120211202

1120311203
auto [Mask, VL] = getDefaultVLOps(VecVT, ContainerVecVT, DL, DAG, Subtarget);
1120411204

@@ -11312,7 +11312,7 @@ SDValue RISCVTargetLowering::lowerEXTRACT_SUBVECTOR(SDValue Op,
1131211312
if (auto ShrunkVT =
1131311313
getSmallestVTForIndex(ContainerVT, LastIdx, DL, DAG, Subtarget)) {
1131411314
ContainerVT = *ShrunkVT;
11315-
Vec = DAG.getExtractLowSubvector(DL, ContainerVT, Vec);
11315+
Vec = DAG.getExtractSubvector(DL, ContainerVT, Vec, 0);
1131611316
}
1131711317

1131811318
SDValue Mask =
@@ -11325,7 +11325,7 @@ SDValue RISCVTargetLowering::lowerEXTRACT_SUBVECTOR(SDValue Op,
1132511325
getVSlidedown(DAG, Subtarget, DL, ContainerVT,
1132611326
DAG.getUNDEF(ContainerVT), Vec, SlidedownAmt, Mask, VL);
1132711327
// Now we can use a cast-like subvector extract to get the result.
11328-
Slidedown = DAG.getExtractLowSubvector(DL, SubVecVT, Slidedown);
11328+
Slidedown = DAG.getExtractSubvector(DL, SubVecVT, Slidedown, 0);
1132911329
return DAG.getBitcast(Op.getValueType(), Slidedown);
1133011330
}
1133111331

@@ -11412,7 +11412,7 @@ SDValue RISCVTargetLowering::lowerEXTRACT_SUBVECTOR(SDValue Op,
1141211412

1141311413
// Now the vector is in the right position, extract our final subvector. This
1141411414
// should resolve to a COPY.
11415-
Slidedown = DAG.getExtractLowSubvector(DL, SubVecVT, Slidedown);
11415+
Slidedown = DAG.getExtractSubvector(DL, SubVecVT, Slidedown, 0);
1141611416

1141711417
// We might have bitcast from a mask type: cast back to the original type if
1141811418
// required.
@@ -11515,15 +11515,15 @@ SDValue RISCVTargetLowering::lowerVECTOR_DEINTERLEAVE(SDValue Op,
1151511515
if (SDValue Src = foldConcatVector(V1, V2);
1151611516
Src && getLMUL1VT(VT).bitsGT(VT)) {
1151711517
EVT NewVT = VT.getDoubleNumVectorElementsVT();
11518-
Src = DAG.getExtractLowSubvector(DL, NewVT, Src);
11518+
Src = DAG.getExtractSubvector(DL, NewVT, Src, 0);
1151911519
// Freeze the source so we can increase its use count.
1152011520
Src = DAG.getFreeze(Src);
1152111521
SDValue Even = lowerVZIP(RISCVISD::RI_VUNZIP2A_VL, Src,
1152211522
DAG.getUNDEF(NewVT), DL, DAG, Subtarget);
1152311523
SDValue Odd = lowerVZIP(RISCVISD::RI_VUNZIP2B_VL, Src,
1152411524
DAG.getUNDEF(NewVT), DL, DAG, Subtarget);
11525-
Even = DAG.getExtractLowSubvector(DL, VT, Even);
11526-
Odd = DAG.getExtractLowSubvector(DL, VT, Odd);
11525+
Even = DAG.getExtractSubvector(DL, VT, Even, 0);
11526+
Odd = DAG.getExtractSubvector(DL, VT, Odd, 0);
1152711527
return DAG.getMergeValues({Even, Odd}, DL);
1152811528
}
1152911529

@@ -11567,11 +11567,11 @@ SDValue RISCVTargetLowering::lowerVECTOR_DEINTERLEAVE(SDValue Op,
1156711567

1156811568
SDValue EvenSplat = DAG.getConstant(0b01010101, DL, MVT::nxv8i8);
1156911569
EvenSplat = DAG.getBitcast(MVT::nxv64i1, EvenSplat);
11570-
SDValue EvenMask = DAG.getExtractLowSubvector(DL, MaskVT, EvenSplat);
11570+
SDValue EvenMask = DAG.getExtractSubvector(DL, MaskVT, EvenSplat, 0);
1157111571

1157211572
SDValue OddSplat = DAG.getConstant(0b10101010, DL, MVT::nxv8i8);
1157311573
OddSplat = DAG.getBitcast(MVT::nxv64i1, OddSplat);
11574-
SDValue OddMask = DAG.getExtractLowSubvector(DL, MaskVT, OddSplat);
11574+
SDValue OddMask = DAG.getExtractSubvector(DL, MaskVT, OddSplat, 0);
1157511575

1157611576
// vcompress the even and odd elements into two separate vectors
1157711577
SDValue EvenWide = DAG.getNode(ISD::VECTOR_COMPRESS, DL, ConcatVT, Concat,
@@ -11951,7 +11951,7 @@ SDValue RISCVTargetLowering::lowerVECTOR_REVERSE(SDValue Op,
1195111951
Hi = DAG.getNode(ISD::VECTOR_REVERSE, DL, HiVT, Hi);
1195211952
// Reassemble the low and high pieces reversed.
1195311953
// FIXME: This is a CONCAT_VECTORS.
11954-
SDValue Res = DAG.getInsertLowSubvector(DL, DAG.getUNDEF(VecVT), Hi);
11954+
SDValue Res = DAG.getInsertSubvector(DL, DAG.getUNDEF(VecVT), Hi, 0);
1195511955
return DAG.getNode(
1195611956
ISD::INSERT_SUBVECTOR, DL, VecVT, Res, Lo,
1195711957
DAG.getVectorIdxConstant(LoVT.getVectorMinNumElements(), DL));
@@ -12100,7 +12100,7 @@ RISCVTargetLowering::lowerFixedLengthVectorStoreToRVV(SDValue Op,
1210012100
if (VT.getVectorElementType() == MVT::i1 && VT.getVectorNumElements() < 8) {
1210112101
VT = MVT::v8i1;
1210212102
StoreVal =
12103-
DAG.getInsertLowSubvector(DL, DAG.getConstant(0, DL, VT), StoreVal);
12103+
DAG.getInsertSubvector(DL, DAG.getConstant(0, DL, VT), StoreVal, 0);
1210412104
}
1210512105

1210612106
MVT ContainerVT = getContainerForFixedLengthVector(VT);
@@ -14532,7 +14532,7 @@ static SDValue combineBinOpToReduce(SDNode *N, SelectionDAG &DAG,
1453214532
// If we looked through an INSERT_SUBVECTOR we need to restore it.
1453314533
if (ScalarVT != ScalarV.getValueType())
1453414534
NewScalarV =
14535-
DAG.getInsertLowSubvector(DL, DAG.getUNDEF(ScalarVT), NewScalarV);
14535+
DAG.getInsertSubvector(DL, DAG.getUNDEF(ScalarVT), NewScalarV, 0);
1453614536

1453714537
SDValue Ops[] = {Reduce.getOperand(0), Reduce.getOperand(1),
1453814538
NewScalarV, Reduce.getOperand(3),
@@ -19662,10 +19662,10 @@ SDValue RISCVTargetLowering::PerformDAGCombine(SDNode *N,
1966219662
// Use M1 or smaller to avoid over constraining register allocation
1966319663
const MVT M1VT = getLMUL1VT(VT);
1966419664
if (M1VT.bitsLT(VT)) {
19665-
SDValue M1Passthru = DAG.getExtractLowSubvector(DL, M1VT, Passthru);
19665+
SDValue M1Passthru = DAG.getExtractSubvector(DL, M1VT, Passthru, 0);
1966619666
SDValue Result =
1966719667
DAG.getNode(N->getOpcode(), DL, M1VT, M1Passthru, Scalar, VL);
19668-
Result = DAG.getInsertLowSubvector(DL, Passthru, Result);
19668+
Result = DAG.getInsertSubvector(DL, Passthru, Result, 0);
1966919669
return Result;
1967019670
}
1967119671

@@ -19684,7 +19684,7 @@ SDValue RISCVTargetLowering::PerformDAGCombine(SDNode *N,
1968419684
MVT VecVT = N->getOperand(0).getSimpleValueType();
1968519685
const MVT M1VT = getLMUL1VT(VecVT);
1968619686
if (M1VT.bitsLT(VecVT)) {
19687-
Vec = DAG.getExtractLowSubvector(DL, M1VT, Vec);
19687+
Vec = DAG.getExtractSubvector(DL, M1VT, Vec, 0);
1968819688
return DAG.getNode(RISCVISD::VMV_X_S, DL, N->getSimpleValueType(0), Vec);
1968919689
}
1969019690
break;
@@ -23316,11 +23316,11 @@ bool RISCVTargetLowering::splitValueIntoRegisterParts(
2331623316
assert(Count != 0 && "The number of element should not be zero.");
2331723317
EVT SameEltTypeVT =
2331823318
EVT::getVectorVT(Context, ValueEltVT, Count, /*IsScalable=*/true);
23319-
Val = DAG.getInsertLowSubvector(DL, DAG.getUNDEF(SameEltTypeVT), Val);
23319+
Val = DAG.getInsertSubvector(DL, DAG.getUNDEF(SameEltTypeVT), Val, 0);
2332023320
}
2332123321
Val = DAG.getNode(ISD::BITCAST, DL, PartVT, Val);
2332223322
} else {
23323-
Val = DAG.getInsertLowSubvector(DL, DAG.getUNDEF(PartVT), Val);
23323+
Val = DAG.getInsertSubvector(DL, DAG.getUNDEF(PartVT), Val, 0);
2332423324
}
2332523325
Parts[0] = Val;
2332623326
return true;
@@ -23389,7 +23389,7 @@ SDValue RISCVTargetLowering::joinRegisterPartsIntoValue(
2338923389
EVT::getVectorVT(Context, ValueEltVT, Count, /*IsScalable=*/true);
2339023390
Val = DAG.getNode(ISD::BITCAST, DL, SameEltTypeVT, Val);
2339123391
}
23392-
Val = DAG.getExtractLowSubvector(DL, ValueVT, Val);
23392+
Val = DAG.getExtractSubvector(DL, ValueVT, Val, 0);
2339323393
return Val;
2339423394
}
2339523395
}

0 commit comments

Comments
 (0)