From 17e678be87104a4b2fbc8910b695d20ae2385527 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Wed, 29 Oct 2008 14:22:20 +0000 Subject: Add sanity checking for BUILD_PAIR (I noticed the other day that PPC custom lowering could create a BUILD_PAIR of two f64 with a result type of... f64! - already fixed). Fix a place that triggers the sanity check. llvm-svn: 58378 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index d04daeb76b5..e34e78fca6d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -390,14 +390,17 @@ static SDValue getCopyFromParts(SelectionDAG &DAG, ValueVT : MVT::getIntegerVT(RoundBits); SDValue Lo, Hi; + MVT HalfVT = ValueVT.isInteger() ? + MVT::getIntegerVT(RoundBits/2) : + MVT::getFloatingPointVT(RoundBits/2); + if (RoundParts > 2) { - MVT HalfVT = MVT::getIntegerVT(RoundBits/2); Lo = getCopyFromParts(DAG, Parts, RoundParts/2, PartVT, HalfVT); Hi = getCopyFromParts(DAG, Parts+RoundParts/2, RoundParts/2, PartVT, HalfVT); } else { - Lo = Parts[0]; - Hi = Parts[1]; + Lo = DAG.getNode(ISD::BIT_CONVERT, HalfVT, Parts[0]); + Hi = DAG.getNode(ISD::BIT_CONVERT, HalfVT, Parts[1]); } if (TLI.isBigEndian()) std::swap(Lo, Hi); -- cgit v1.2.3