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

Andrew Trick atrick at apple.com
Tue May 29 12:52:42 PDT 2012


On May 29, 2012, at 9:35 AM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:

> I can see two ways of fixing pr12979. On is giving different numbers
> to 'add' and 'add nsw'. Another one is patching the replacement to
> make it at least as general as the value being replaced.
> 
> I went with the second option, since we probably want to combined the
> two instructions at some point once potential uses of the nsw bit have
> been exploited.

Sure. It seems reasonable to me to expect optimizations that depend on nsw to run before gvn.

> The patch is incomplete since I am not sure what is the best thing to
> do about the metadata.

Me neither, but your suggestions make sense. I would drop unknown metadata.

-Andy

> If I understand the code correctly, loads are handled in a different
> location, so we don't have to worry about range and tbaa in here. For
> fpmath I think we should keep the most precise of the two.
> 
> For debug info, it is probably better to keep the info attached to the
> replacement.
> 
> What should we do with unknown metadata types? I think we have to drop
> it, but I don't know if there was a decision on some other merging
> rules.
> 
> Cheers,
> Rafael
> <t.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list