[llvm-commits] [llvm] r59760 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Dan Gohman gohman at apple.com
Thu Nov 20 17:58:53 PST 2008


On Nov 20, 2008, at 5:41 PM, Chris Lattner wrote:

>
> On Nov 20, 2008, at 5:08 PM, Dan Gohman wrote:
>
>>
>> On Nov 20, 2008, at 4:38 PM, Bill Wendling wrote:
>>
>>> On Thu, Nov 20, 2008 at 4:22 PM, Dan Gohman <gohman at apple.com>  
>>> wrote:
>>>>
>>>> On Nov 20, 2008, at 4:11 PM, Bill Wendling wrote:
>>>>> +
>>>>> +    // Overflow-aware nodes for arithmetic operations. These  
>>>>> nodes
>>>>> take two
>>>>> +    // operands: the normal lhs and rhs to the add. They produce
>>>>> two results:
>>>>> +    // the normal result of the add, and a flag indicating  
>>>>> whether
>>>>> an overflow
>>>>> +    // occured. These nodes are generated from the llvm.
>>>>> [su]add.with.overflow
>>>>> +    // intrinsics. They are lowered by target-dependent code.
>>>>> +    SADDO, UADDO,
>>>>
>>>> Hi Bill,
>>>>
>>>> Is UADDO is equivalent to ADDC?
>>>>
>>> Hmm. It does appear to be similar. How is ADDC handled later on? I
>>> see
>>> that the DAG combiner does some reasoning about trivial cases, but
>>> how
>>> is it handled in the back ends?
>>
>> In the x86 backend, ADDC is lowered to a single add instruction, with
>> the carry information carried by the flags register.
>
> They aren't the same.  ADDC returns a value + flag.  SADDO returns a
> value + bool.  The use of the bool may very well be a store to memory
> or something like that.  You can't flag these together.

Ok. Bill, can you update the comment to reflect this?

Thanks,

Dan




More information about the llvm-commits mailing list