[llvm-commits] [llvm] r76215 - /llvm/trunk/include/llvm/Value.h

Nick Lewycky nicholas at mxc.ca
Tue Jul 21 23:24:39 PDT 2009


Dan Gohman wrote:
> On Jul 18, 2009, at 1:06 PM, Duncan Sands wrote:
> 
> 
>> Hi Dan,
>>
>>
>>> This optional data is information like "signed overflow is  
>>> undefined".
>>>
>> why is this set up as optional data?  Shouldn't it be a full blown  
>> flag
>> on the operation, analogous to a parameter attribute?
> 
> The design idea here is that these are flags which are not necessary for
> correctness. A "signed add" is not a different operation from an "add";
> it's just an "add" with some value-range information that the optimizer
> may find useful.

I humbly object to the term "signed" here. There's no such thing as a 
signed add but there is such thing as an add that won't overflow. Since 
it won't overflow we aren't required to preserve the behaviour if it 
did. It's a 'nooverflow' add you might call it, as opposed to a wrapping 
add (what we have now), trapping add or saturating add.

Perhaps just 'nooverflow', 'wrap', 'trap' and 'saturate' as keywords? 
I'd like something shorter than nooverflow ('nowrap'?) if possible.

Nick



More information about the llvm-commits mailing list