summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-11-27 00:43:21 +0000
committerDale Johannesen <dalej@apple.com>2008-11-27 00:43:21 +0000
commit73bc0ba4c965cb83e076cb7f80df3c737c8f1dc0 (patch)
tree32a8769adbf1158c1fd254be78cd98812a0a455d /llvm/lib/CodeGen
parent1f50dc899fc5521341462c15c36cc4c2055ca78c (diff)
downloadbcm5719-llvm-73bc0ba4c965cb83e076cb7f80df3c737c8f1dc0.tar.gz
bcm5719-llvm-73bc0ba4c965cb83e076cb7f80df3c737c8f1dc0.zip
Add a missing case in visitADD.
llvm-svn: 60137
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 762fcedc7fb..6b35126a10e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud