diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2007-12-19 01:34:38 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2007-12-19 01:34:38 +0000 |
| commit | 9f06e5e2dfbc21f9e0e535666a4b782695e85b26 (patch) | |
| tree | cc59c4161dba3eb28284030a2fb34a7a8eb12c93 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
| parent | f4c38c9289aeb90f6aaff039a5b23ca234faa352 (diff) | |
| download | bcm5719-llvm-9f06e5e2dfbc21f9e0e535666a4b782695e85b26.tar.gz bcm5719-llvm-9f06e5e2dfbc21f9e0e535666a4b782695e85b26.zip | |
Don't leave newly created nodes around if it turns out they are not needed.
llvm-svn: 45186
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 1400c3ee4f9..a1d8ad95de5 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -1446,7 +1446,8 @@ bool DAGCombiner::SimplifyNodeWithTwoResults(SDNode *N, TLI.isOperationLegal(LoOpt.getOpcode(), LoOpt.getValueType())) { RetVal = true; DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 0), LoOpt); - } + } else + DAG.DeleteNode(Lo.Val); } if (HiExists) { @@ -1457,7 +1458,8 @@ bool DAGCombiner::SimplifyNodeWithTwoResults(SDNode *N, TLI.isOperationLegal(HiOpt.getOpcode(), HiOpt.getValueType())) { RetVal = true; DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 1), HiOpt); - } + } else + DAG.DeleteNode(Hi.Val); } return RetVal; |

