Skip to content

Commit

Permalink
[LegalizeTypes] Remove the call to SplitVecRes_UnaryOp from SplitVecR…
Browse files Browse the repository at this point in the history
…es_StrictFPOp. NFCI

It doesn't seem to do anything that SplitVecRes_StrictFPOp can't
do. SplitVecRes_StrictFPOp already handles nodes with a variable
number of arguments and a mix of scalar and vector arguments.
  • Loading branch information
topperc committed Dec 17, 2019
1 parent 9718201 commit c4d2bb1
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
Expand Up @@ -1254,17 +1254,6 @@ void DAGTypeLegalizer::SplitVecRes_ExtVecInRegOp(SDNode *N, SDValue &Lo,

void DAGTypeLegalizer::SplitVecRes_StrictFPOp(SDNode *N, SDValue &Lo,
SDValue &Hi) {
switch (N->getOpcode()) {
case ISD::STRICT_FP_EXTEND:
case ISD::STRICT_FP_ROUND:
case ISD::STRICT_FP_TO_SINT:
case ISD::STRICT_FP_TO_UINT:
SplitVecRes_UnaryOp(N, Lo, Hi);
return;
default:
break;
}

unsigned NumOps = N->getNumOperands();
SDValue Chain = N->getOperand(0);
EVT LoVT, HiVT;
Expand Down Expand Up @@ -1719,24 +1708,6 @@ void DAGTypeLegalizer::SplitVecRes_UnaryOp(SDNode *N, SDValue &Lo,
if (N->getOpcode() == ISD::FP_ROUND) {
Lo = DAG.getNode(N->getOpcode(), dl, LoVT, Lo, N->getOperand(1));
Hi = DAG.getNode(N->getOpcode(), dl, HiVT, Hi, N->getOperand(1));
} else if (N->getOpcode() == ISD::STRICT_FP_ROUND) {
Lo = DAG.getNode(N->getOpcode(), dl, { LoVT, MVT::Other },
{ N->getOperand(0), Lo, N->getOperand(2) });
Hi = DAG.getNode(N->getOpcode(), dl, { HiVT, MVT::Other },
{ N->getOperand(0), Hi, N->getOperand(2) });
SDValue NewChain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,
Lo.getValue(1), Hi.getValue(1));
ReplaceValueWith(SDValue(N, 1), NewChain);
} else if (N->isStrictFPOpcode()) {
Lo = DAG.getNode(N->getOpcode(), dl, { LoVT, MVT::Other },
{ N->getOperand(0), Lo });
Hi = DAG.getNode(N->getOpcode(), dl, { HiVT, MVT::Other },
{ N->getOperand(0), Hi });
// Legalize the chain result - switch anything that used the old chain to
// use the new one.
SDValue NewChain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,
Lo.getValue(1), Hi.getValue(1));
ReplaceValueWith(SDValue(N, 1), NewChain);
} else {
Lo = DAG.getNode(N->getOpcode(), dl, LoVT, Lo);
Hi = DAG.getNode(N->getOpcode(), dl, HiVT, Hi);
Expand Down

0 comments on commit c4d2bb1

Please sign in to comment.