projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bc7e0f5
)
Add a missing case in visitADD.
author
Dale Johannesen
<dalej@apple.com>
Thu, 27 Nov 2008 00:43:21 +0000
(
00:43
+0000)
committer
Dale Johannesen
<dalej@apple.com>
Thu, 27 Nov 2008 00:43:21 +0000
(
00:43
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60137
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
patch
|
blob
|
history
diff --git
a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 762fcedc7fb18753b45eb2972d1dc5aa8ecfdcf7..6b35126a10ecbed26e3e7c7e6470fd45cdf5718b 100644
(file)
--- 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);