From d3db7b40b0538f737c5a519d18845e9db10df025 Mon Sep 17 00:00:00 2001 From: "Kevin P. Neal" Date: Thu, 30 May 2019 17:10:21 +0000 Subject: Revert r362112, it broke the bots with the message "Unsupported vector argument or return type" Differential Revision: http://reviews.llvm.org/D62546 llvm-svn: 362117 --- llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h | 5 -- .../CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 59 +--------------------- 2 files changed, 1 insertion(+), 63 deletions(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h index 8beaf145e0f..a0e7c8a89c1 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h @@ -857,11 +857,6 @@ private: SDValue WidenVecOp_FCOPYSIGN(SDNode *N); SDValue WidenVecOp_VECREDUCE(SDNode *N); - /// Helper function to generate a set of operations to perform - /// a vector operation for a wider type. - /// - SDValue UnrollVectorOp_StrictFP(SDNode *N, unsigned ResNE); - //===--------------------------------------------------------------------===// // Vector Widening Utilities Support: LegalizeVectorTypes.cpp //===--------------------------------------------------------------------===// diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp index 072f15b1f4c..95aace3dc9a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -1318,63 +1318,6 @@ void DAGTypeLegalizer::SplitVecRes_StrictFPOp(SDNode *N, SDValue &Lo, ReplaceValueWith(SDValue(N, 1), Chain); } -SDValue DAGTypeLegalizer::UnrollVectorOp_StrictFP(SDNode *N, unsigned ResNE) { - SDValue Chain = N->getOperand(0); - EVT VT = N->getValueType(0); - unsigned NE = VT.getVectorNumElements(); - EVT EltVT = VT.getVectorElementType(); - SDLoc dl(N); - - SmallVector Scalars; - SmallVector Operands(N->getNumOperands()); - - // If ResNE is 0, fully unroll the vector op. - if (ResNE == 0) - ResNE = NE; - else if (NE > ResNE) - NE = ResNE; - - //The results of each unrolled operation, including the chain. - EVT ChainVTs[] = {EltVT, MVT::Other}; - SmallVector Chains; - - unsigned i; - for (i = 0; i != NE; ++i) { - Operands[0] = Chain; - for (unsigned j = 1, e = N->getNumOperands(); j != e; ++j) { - SDValue Operand = N->getOperand(j); - EVT OperandVT = Operand.getValueType(); - if (OperandVT.isVector()) { - EVT OperandEltVT = OperandVT.getVectorElementType(); - Operands[j] = - DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, OperandEltVT, Operand, - DAG.getConstant(i, dl, TLI.getVectorIdxTy( - DAG.getDataLayout()))); - } else { - Operands[j] = Operand; - } - } - SDValue Scalar = DAG.getNode(N->getOpcode(), dl, ChainVTs, Operands); - Scalar.getNode()->setFlags(N->getFlags()); - - //Add in the scalar as well as its chain value to the - //result vectors. - Scalars.push_back(Scalar); - Chains.push_back(Scalar.getValue(1)); - } - - for (; i < ResNE; ++i) - Scalars.push_back(DAG.getUNDEF(EltVT)); - - // Build a new factor node to connect the chain back together. - Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Chains); - ReplaceValueWith(SDValue(N, 1), Chain); - - // Create a new BUILD_VECTOR node - EVT VecVT = EVT::getVectorVT(*DAG.getContext(), EltVT, ResNE); - return DAG.getBuildVector(VecVT, dl, Scalars); -} - void DAGTypeLegalizer::SplitVecRes_OverflowOp(SDNode *N, unsigned ResNo, SDValue &Lo, SDValue &Hi) { SDLoc dl(N); @@ -3025,7 +2968,7 @@ SDValue DAGTypeLegalizer::WidenVecRes_StrictFP(SDNode *N) { // No legal vector version so unroll the vector operation and then widen. if (NumElts == 1) - return UnrollVectorOp_StrictFP(N, WidenVT.getVectorNumElements()); + return UnrollVectorOp(N, WidenVT.getVectorNumElements()); // Since the operation can trap, apply operation on the original vector. EVT MaxVT = VT; -- cgit v1.2.3