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

Duncan Sands baldrick at free.fr
Tue May 29 13:32:27 PDT 2012


Hi Rafael,

On 29/05/12 22:19, Rafael EspĂ­ndola wrote:
>> The patch is incomplete since I am not sure what is the best thing to
>> do about the metadata.
>
> I have implemented the following
>
> * Keep the most generic tbaa, i.e., the one closest to the root.
> * Keep the most generic fpmath, i.e., the one with the smallest value.

This seems right.  For range metadata you should form the union of the
ranges I guess.

> * Keep the dbg and prof of the value we are replacing.

It seems a pity not to be symmetric between the two pieces of metadata, but I
suppose this is inevitable in the case of dbg if it doesn't support attaching
multiple line numbers etc to one instruction.  As for prof, it's not documented
in the LangRef so I don't know what it is.  If it is some kind of frequency of
occurrence, maybe it should be replaced by the sum?

> * Drop metadata we know nothing about.

This seems right.

In any case I think this should be a generic method on metadata, i.e. not live
in GVN.  For example probably EarlyCSE needs it too.

Ciao, Duncan.



More information about the llvm-commits mailing list