diff options
author | Dale Johannesen <dalej@apple.com> | 2008-11-27 00:43:21 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-11-27 00:43:21 +0000 |
commit | 56eca9103ecbf2293842bfd6067ac26629221eaf (patch) | |
tree | 23b19869c9ecc8f1bda680cbbe65d0d5f1c96017 /lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | bc7e0f5dd637ea365f0cb316cda68668f9e3e7d3 (diff) |
Add a missing case in visitADD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 762fcedc7f..6b35126a10 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -1010,6 +1010,9 @@ SDValue DAGCombiner::visitADD(SDNode *N) { // fold (A+(B-A)) -> B if (N1.getOpcode() == ISD::SUB && N0 == N1.getOperand(1)) return N1.getOperand(0); + // fold ((B-A)+A) -> B + if (N0.getOpcode() == ISD::SUB && N1 == N0.getOperand(1)) + return N0.getOperand(0); if (!VT.isVector() && SimplifyDemandedBits(SDValue(N, 0))) return SDValue(N, 0); |