diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-05-12 06:54:21 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-05-12 06:54:21 +0000 |
| commit | 8a5ad8468a9951217cef36380504a235f0f11ddb (patch) | |
| tree | fb9dbe1da65a999be9ebd31d74bac1a73f98e7d3 /llvm/lib/CodeGen/SelectionDAG | |
| parent | d2fb9ea26221b4f4475c470ee4b36bc95ccd4bfc (diff) | |
| download | bcm5719-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.cpp | 7 |
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 |

