[llvm-commits] [llvm] r60857 - in /llvm/trunk: lib/CodeGen/SelectionDAG/DAGCombiner.cpp test/CodeGen/X86/add-with-overflow.ll

Bill Wendling isanbard at gmail.com
Thu Dec 11 00:23:10 PST 2008


On Dec 10, 2008, at 3:44 PM, Eli Friedman wrote:

> On Wed, Dec 10, 2008 at 2:36 PM, Bill Wendling <isanbard at gmail.com>  
> wrote:
>> Author: void
>> Date: Wed Dec 10 16:36:00 2008
>> New Revision: 60857
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=60857&view=rev
>> Log:
>> If ADD, SUB, or MUL have an overflow bit that's used, don't do  
>> transformation on
>> them. The DAG combiner expects that nodes that are transformed have  
>> one value
>> result.
>
> This approach somehow seems a little scary; I'm not completely sure,
> but do we really want target-independent nodes producing
> platform-specific results?  I don't think any other code does this,
> and it seems like it's overloading the semantics in a dangerous way.
> Is there some particular reason why you preferred this over adding
> instructions like X86ISD::ADD_FLAGS for an add that sets EFLAGS?
>
The idea is that there be platform independent ways of calculating  
when an overflow has occurred, and rely upon target-specific lowering  
when the target can handle the flags. This is what ADDO and SUBO do.  
MULO is trickier, so it doesn't do that . . . yet.

-bw




More information about the llvm-commits mailing list