Skip to content

Commit 23558af

Browse files
authored
[RISCV] Hoist duplicate code in lowerINSERT_SUBVECTOR. NFC (#109733)
1 parent 3cd3202 commit 23558af

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10204,17 +10204,15 @@ SDValue RISCVTargetLowering::lowerINSERT_SUBVECTOR(SDValue Op,
1020410204
Vec = convertToScalableVector(ContainerVT, Vec, DAG, Subtarget);
1020510205
}
1020610206

10207+
SubVec = DAG.getNode(ISD::INSERT_SUBVECTOR, DL, ContainerVT,
10208+
DAG.getUNDEF(ContainerVT), SubVec,
10209+
DAG.getVectorIdxConstant(0, DL));
10210+
1020710211
if (OrigIdx == 0 && Vec.isUndef() && VecVT.isFixedLengthVector()) {
10208-
SubVec = DAG.getNode(ISD::INSERT_SUBVECTOR, DL, ContainerVT,
10209-
DAG.getUNDEF(ContainerVT), SubVec,
10210-
DAG.getVectorIdxConstant(0, DL));
1021110212
SubVec = convertFromScalableVector(VecVT, SubVec, DAG, Subtarget);
1021210213
return DAG.getBitcast(Op.getValueType(), SubVec);
1021310214
}
1021410215

10215-
SubVec = DAG.getNode(ISD::INSERT_SUBVECTOR, DL, ContainerVT,
10216-
DAG.getUNDEF(ContainerVT), SubVec,
10217-
DAG.getVectorIdxConstant(0, DL));
1021810216
SDValue Mask =
1021910217
getDefaultVLOps(VecVT, ContainerVT, DL, DAG, Subtarget).first;
1022010218
// Set the vector length to only the number of elements we care about. Note

0 commit comments

Comments
 (0)