summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-12 06:54:21 +0000
committerChris Lattner <sabre@nondot.org>2005-05-12 06:54:21 +0000
commit8a5ad8468a9951217cef36380504a235f0f11ddb (patch)
treefb9dbe1da65a999be9ebd31d74bac1a73f98e7d3 /llvm/lib/CodeGen/SelectionDAG
parentd2fb9ea26221b4f4475c470ee4b36bc95ccd4bfc (diff)
downloadbcm5719-llvm-8a5ad8468a9951217cef36380504a235f0f11ddb.tar.gz
bcm5719-llvm-8a5ad8468a9951217cef36380504a235f0f11ddb.zip
Make sure to expand all nodes, avoiding unintentional node duplication.
llvm-svn: 21889
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index b8c4315e512..5cc148a84f5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -2168,6 +2168,13 @@ ExpandIntToFP(bool isSigned, MVT::ValueType DestTy, SDOperand Source) {
TargetLowering::ArgListTy Args;
const Type *ArgTy = MVT::getTypeForValueType(Source.getValueType());
+
+ // Expand the source, then glue it back together for the call. We must expand
+ // the source in case it is shared (this pass of legalize must traverse it).
+ SDOperand SrcLo, SrcHi;
+ ExpandOp(Source, SrcLo, SrcHi);
+ Source = DAG.getNode(ISD::BUILD_PAIR, Source.getValueType(), SrcLo, SrcHi);
+
Args.push_back(std::make_pair(Source, ArgTy));
// We don't care about token chains for libcalls. We just use the entry
OpenPOWER on IntegriCloud