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 | 02132d62c1ed55fc0d5e03413c314fffc59489f0 (patch) | |
tree | c3768315363414ad448574498dea8e8de8ab9914 /lib | |
parent | 79200788df8d946eae6973709b998a7f3a4cb754 (diff) | |
download | external_llvm-02132d62c1ed55fc0d5e03413c314fffc59489f0.zip external_llvm-02132d62c1ed55fc0d5e03413c314fffc59489f0.tar.gz external_llvm-02132d62c1ed55fc0d5e03413c314fffc59489f0.tar.bz2 |
Don't leave newly created nodes around if it turns out they are not needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45186 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 1400c3e..a1d8ad9 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/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; |