[PATCH] D121673: [RISCV] Remove lowerSPLAT_VECTOR
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 15 08:22:55 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG06c5d74090ff: [RISCV] Remove lowerSPLAT_VECTOR (authored by craig.topper).
Herald added a subscriber: arichardson.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121673/new/
https://reviews.llvm.org/D121673
Files:
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
Index: llvm/lib/Target/RISCV/RISCVISelLowering.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -849,12 +849,13 @@
continue;
}
- // Use SPLAT_VECTOR to prevent type legalization from destroying the
- // splats when type legalizing i64 scalar on RV32.
+ // Make SPLAT_VECTOR Legal so DAGCombine will convert splat vectors to
+ // it before type legalization for i64 vectors on RV32. It will then be
+ // type legalized to SPLAT_VECTOR_PARTS which we need to Custom handle.
// FIXME: Use SPLAT_VECTOR for all types? DAGCombine probably needs
// improvements first.
if (!Subtarget.is64Bit() && VT.getVectorElementType() == MVT::i64) {
- setOperationAction(ISD::SPLAT_VECTOR, VT, Custom);
+ setOperationAction(ISD::SPLAT_VECTOR, VT, Legal);
setOperationAction(ISD::SPLAT_VECTOR_PARTS, VT, Custom);
}
@@ -1885,24 +1886,6 @@
return DAG.getSelect(DL, VT, Setcc, Truncated, Src);
}
-static SDValue lowerSPLAT_VECTOR(SDValue Op, SelectionDAG &DAG,
- const RISCVSubtarget &Subtarget) {
- MVT VT = Op.getSimpleValueType();
- assert(VT.isFixedLengthVector() && "Unexpected vector!");
-
- MVT ContainerVT = getContainerForFixedLengthVector(DAG, VT, Subtarget);
-
- SDLoc DL(Op);
- SDValue Mask, VL;
- std::tie(Mask, VL) = getDefaultVLOps(VT, ContainerVT, DL, DAG, Subtarget);
-
- unsigned Opc =
- VT.isFloatingPoint() ? RISCVISD::VFMV_V_F_VL : RISCVISD::VMV_V_X_VL;
- SDValue Splat = DAG.getNode(Opc, DL, ContainerVT, DAG.getUNDEF(ContainerVT),
- Op.getOperand(0), VL);
- return convertFromScalableVector(VT, Splat, DAG, Subtarget);
-}
-
struct VIDSequence {
int64_t StepNumerator;
unsigned StepDenominator;
@@ -3537,7 +3520,7 @@
case ISD::SPLAT_VECTOR:
if (Op.getValueType().getVectorElementType() == MVT::i1)
return lowerVectorMaskSplat(Op, DAG);
- return lowerSPLAT_VECTOR(Op, DAG, Subtarget);
+ return SDValue();
case ISD::VECTOR_SHUFFLE:
return lowerVECTOR_SHUFFLE(Op, DAG, Subtarget);
case ISD::CONCAT_VECTORS: {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121673.415450.patch
Type: text/x-patch
Size: 2272 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220315/2b373690/attachment.bin>
More information about the llvm-commits
mailing list