diff --git a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp index 0c422d1f99497..7cd52b5edd208 100644 --- a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp @@ -1786,7 +1786,6 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) { ReplaceNode(Node, Extract.getNode()); return; } - case ISD::SPLAT_VECTOR: case RISCVISD::VMV_S_X_VL: case RISCVISD::VFMV_S_F_VL: case RISCVISD::VMV_V_X_VL: @@ -1794,10 +1793,9 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) { // Try to match splat of a scalar load to a strided load with stride of x0. bool IsScalarMove = Node->getOpcode() == RISCVISD::VMV_S_X_VL || Node->getOpcode() == RISCVISD::VFMV_S_F_VL; - bool HasPassthruOperand = Node->getOpcode() != ISD::SPLAT_VECTOR; - if (HasPassthruOperand && !Node->getOperand(0).isUndef()) + if (!Node->getOperand(0).isUndef()) break; - SDValue Src = HasPassthruOperand ? Node->getOperand(1) : Node->getOperand(0); + SDValue Src = Node->getOperand(1); auto *Ld = dyn_cast(Src); if (!Ld) break; @@ -1810,9 +1808,7 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) { break; SDValue VL; - if (Node->getOpcode() == ISD::SPLAT_VECTOR) - VL = CurDAG->getTargetConstant(RISCV::VLMaxSentinel, DL, XLenVT); - else if (IsScalarMove) { + if (IsScalarMove) { // We could deal with more VL if we update the VSETVLI insert pass to // avoid introducing more VSETVLI. if (!isOneConstant(Node->getOperand(2)))