[llvm-commits] [llvm] r61401 - in /llvm/trunk: lib/CodeGen/SelectionDAG/DAGCombiner.cpp test/CodeGen/X86/2008-12-23-dagcombine-6.ll

Chris Lattner clattner at apple.com
Tue Dec 23 15:30:45 PST 2008


On Dec 23, 2008, at 3:16 PM, Dale Johannesen wrote:

>
> On Dec 23, 2008, at 3:14 PMPST, Chris Lattner wrote:
>
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=61401&view=rev
>>> Log:
>>> Add another permutation where we should get rid of a-a.
>>
>>> @@ -1177,13 +1177,20 @@
>>>   return N0.getOperand(1);
>>> // fold (A+B)-B -> A
>>> if (N0.getOpcode() == ISD::ADD && N0.getOperand(1) == N1)
>>> -    return N0.getOperand(0);
>>> -  // fold ((A+(B-C))-B) -> A-C
>>> +    return N0.getOperand(0);
>>> +  // fold ((A+(B+-C))-B) -> A+-C
>>
>> I don't see why you'd ever way to match on A + (-B).  Shouldn't dag
>> combine independently fold this into A-B?
>
> That should be read "plus or minus".

Ah, please clarify the comment, thanks!

-Chris



More information about the llvm-commits mailing list