Skip to content

Commit

Permalink
Revert r362112, it broke the bots with the message "Unsupported vecto…
Browse files Browse the repository at this point in the history
…r argument or return type"

Differential Revision:	http://reviews.llvm.org/D62546

llvm-svn: 362117
  • Loading branch information
kpneal committed May 30, 2019
1 parent aeae786 commit d3db7b4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6,508 deletions.
5 changes: 0 additions & 5 deletions llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
Expand Up @@ -857,11 +857,6 @@ class LLVM_LIBRARY_VISIBILITY DAGTypeLegalizer {
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
//===--------------------------------------------------------------------===//
Expand Down
59 changes: 1 addition & 58 deletions llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
Expand Up @@ -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<SDValue, 8> Scalars;
SmallVector<SDValue, 4> 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<SDValue, 8> 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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d3db7b4

Please sign in to comment.