[PATCH] D29110: LangRef: Document the allowed metadata dropping transforms.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 11:04:31 PST 2017


pcc added a comment.

In https://reviews.llvm.org/D29110#656551, @kparzysz wrote:

> In https://reviews.llvm.org/D29110#656480, @pcc wrote:
>
> > So would it solve the problem if we don't call it metadata? They are "attributes which happen to be represented using the MD* classes".
>
>
> Would it still look like metadata to someone who has not read that piece of documentation?  Would this information invalidate previously correct understanding of the IR?
>
> Imagine that some user somewhere wrote their own LLVM-based compiler that strips all metadata.  If that compiler generated a correct code prior to this change, would it potentially generate a wrong code afterwards?


You can make the same argument for stripping thread_local (etc). Fundamentally there are always going to be properties that need to be preserved for correctness no matter how we represent them and there's no magical way to make sure that clients don't make mistakes.

If we wanted to help compilers "strip all metadata" correctly, we could provide a function that strips all the metadata except for the "attributes represented with MD*".


https://reviews.llvm.org/D29110





More information about the llvm-commits mailing list