diff options
author | Duncan Sands <baldrick@free.fr> | 2008-09-05 08:13:35 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-09-05 08:13:35 +0000 |
commit | 1c11debc94baa65b7af702bbc20c813c266afb19 (patch) | |
tree | c10b4be723f93b89565170a9137f72f0c88599ef | |
parent | 3dd168d4452d0aff4960f01c5a7471a79eec45f3 (diff) |
"Fix" PR2762. The testcase now crashes codegen
elsewhere due to a missing pattern for
v2f64 = sint_to_fp v2i32. That is PR2687.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55828 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp index 6bfc6c6bb6..c365865c2f 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -524,7 +524,25 @@ void DAGTypeLegalizer::SplitVecRes_UnaryOp(SDNode *N, SDValue &Lo, MVT LoVT, HiVT; GetSplitDestVTs(N->getValueType(0), LoVT, HiVT); - GetSplitVector(N->getOperand(0), Lo, Hi); + // Split the input. + MVT InVT = N->getOperand(0).getValueType(); + switch (getTypeAction(InVT)) { + default: assert(0 && "Unexpected type action!"); + case Legal: { + assert(LoVT == HiVT && "Legal non-power-of-two vector type?"); + MVT InNVT = MVT::getVectorVT(InVT.getVectorElementType(), + LoVT.getVectorNumElements()); + Lo = DAG.getNode(ISD::EXTRACT_SUBVECTOR, InNVT, N->getOperand(0), + DAG.getIntPtrConstant(0)); + Hi = DAG.getNode(ISD::EXTRACT_SUBVECTOR, InNVT, N->getOperand(0), + DAG.getIntPtrConstant(InNVT.getVectorNumElements())); + break; + } + case SplitVector: + GetSplitVector(N->getOperand(0), Lo, Hi); + break; + } + Lo = DAG.getNode(N->getOpcode(), LoVT, Lo); Hi = DAG.getNode(N->getOpcode(), HiVT, Hi); } |