[llvm-commits] [pr12979][patch/rfc] Clear nsw/nuw in gvn

Nuno Lopes nunoplopes at sapo.pt
Fri Jun 1 15:39:47 PDT 2012


Hi,

> On 30 May 2012 12:16, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
>>> This seems right.  For range metadata you should form the union of the
>>> ranges I guess.
>>
>> Implemented.
>
> I have rebased it now that the verifier enforces that the range is in
> a canonical form. I have also fixed corner cases like a merge forming
> the full set.


Although I'm arriving a bit late to the discussion, let me just write  
my thoughts on this.
I think that with range metadata we can be more aggressive. For  
example, if you have the following:
%a = load i32* %p, !range !1
%b = load i32* %p, !range !2

I think the resulting range should be the *intersection*, and not the  
union of the ranges.  Someone says: "I'm sure this value is between 0  
and 5", and someone else says "I'm sure that value is between 3 and  
6".  Then we know that the value must be between 3 and 5;  we don't  
need to expand our beliefs to be between 0 and 6.
(of course this reasoning assumes that ranges are always conservative,  
which must be the case, anyway)

For TBAA info, I think the same reasoning applies. I think we can pick  
the strongest aliasing information. If someone already said that some  
pointer doesn't always with anything for sure, we don't need to  
consider the case that it may alias with something.

For fpmath, I agree we should pick the most precise of the two.

Nuno




More information about the llvm-commits mailing list