Skip to content

Commit 9895285

Browse files
committed
[RISCV] Replace 'return ReplaceNode' with 'ReplaceNode; return;' NFC
ReplaceNode is a void function as is the function that we were doing this in. While this is valid code, it was a bit confusing.
1 parent 6e36859 commit 9895285

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) {
411411
}
412412
ReplaceNode(Node, selectImm(CurDAG, DL, ConstNode->getSExtValue(), XLenVT));
413413
return;
414-
break;
415414
}
416415
case ISD::FrameIndex: {
417416
SDValue Imm = CurDAG->getTargetConstant(0, DL, XLenVT);
@@ -925,11 +924,13 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) {
925924
SDValue RC = CurDAG->getTargetConstant(InRegClassID, DL, XLenVT);
926925
SDNode *NewNode = CurDAG->getMachineNode(TargetOpcode::COPY_TO_REGCLASS,
927926
DL, VT, SubV, RC);
928-
return ReplaceNode(Node, NewNode);
927+
ReplaceNode(Node, NewNode);
928+
return;
929929
}
930930

931931
SDValue Insert = CurDAG->getTargetInsertSubreg(SubRegIdx, DL, VT, V, SubV);
932-
return ReplaceNode(Node, Insert.getNode());
932+
ReplaceNode(Node, Insert.getNode());
933+
return;
933934
}
934935
case ISD::EXTRACT_SUBVECTOR: {
935936
SDValue V = Node->getOperand(0);
@@ -968,11 +969,13 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) {
968969
SDValue RC = CurDAG->getTargetConstant(InRegClassID, DL, XLenVT);
969970
SDNode *NewNode =
970971
CurDAG->getMachineNode(TargetOpcode::COPY_TO_REGCLASS, DL, VT, V, RC);
971-
return ReplaceNode(Node, NewNode);
972+
ReplaceNode(Node, NewNode);
973+
return;
972974
}
973975

974976
SDValue Extract = CurDAG->getTargetExtractSubreg(SubRegIdx, DL, VT, V);
975-
return ReplaceNode(Node, Extract.getNode());
977+
ReplaceNode(Node, Extract.getNode());
978+
return;
976979
}
977980
}
978981

0 commit comments

Comments
 (0)