summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-10-29 14:22:20 +0000
committerDuncan Sands <baldrick@free.fr>2008-10-29 14:22:20 +0000
commit17e678be87104a4b2fbc8910b695d20ae2385527 (patch)
tree94a471b6dc3fa29f6f8886d08a0f7bbce55d303b /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
parent9774aa13c747c5fb6d933109a4a2a5d2d4924264 (diff)
downloadbcm5719-llvm-17e678be87104a4b2fbc8910b695d20ae2385527.tar.gz
bcm5719-llvm-17e678be87104a4b2fbc8910b695d20ae2385527.zip
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
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp9
1 files changed, 6 insertions, 3 deletions
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);
OpenPOWER on IntegriCloud