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 | 44d105b7faf5672a2af61a3f0fdfed0d437d5777 (patch) | |
tree | ff8eec5a042d0f4d9e03c7910166a50d3a65af4c | |
parent | 6980d8295f415caa752b45c745c25a9be0079a9a (diff) |
Make sure to expand all nodes, avoiding unintentional node duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21889 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index b8c4315e51..5cc148a84f 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/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 |