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

Rafael Espíndola rafael.espindola at gmail.com
Wed May 30 09:16:25 PDT 2012


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

Implemented.

>> * 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?

It is documented in docs/BranchWeightMetadata.html :-(

Since it is only attached to terminators, I added an assert that we
don't see it.

> 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.

I agree that some can be shared, but it is not clear how much. For
example, maybe EarlyCSE should avoid merging instead of merging and
stripping. PR12985 might also be able to use some of this code.

In any case, if you are OK with it, I would like to fix and test GVN
first and then refator as needed. The attached patch should be an
improvement as is. There is still some uses of
patchAndReplaceAllUsesWith in GVN.cpp to be audited, but I think they
can be fixed independently with the current code structure.

> Ciao, Duncan.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 11761 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120530/09ebed9b/attachment.obj>


More information about the llvm-commits mailing list