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

Eric Christopher echristo at apple.com
Tue Dec 23 15:38:10 PST 2008


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

>
> On Dec 23, 2008, at 3:30 PMPST, Chris Lattner wrote:
>
>>
>> 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!
>
> What would you prefer?  I've used this elsewhere without confusing
> anybody.

*raises hand*

Now that I'm reading it I'd be confused.

A +/- B ?

-eric



More information about the llvm-commits mailing list