[cfe-dev] [LLVMdev] [RFC] Module Flags Metadata

Chandler Carruth chandlerc at google.com
Tue Jan 24 15:46:31 PST 2012

On Tue, Jan 24, 2012 at 3:39 PM, Devang Patel <dpatel at apple.com> wrote:

> This is a simplified understanding of semantics. As I understand, the
> expected metadata design behavior is that optimizer/transformations are not
> responsible to preserve any _relationship_ between a User and a MDNode. For
> example, if a MDNode is  "using" a User then optimizer can remove the User
> without bothering about what happens to the MDNode. Same way, If MDNode is
> attached to an Instruction then optimizer can mutate, delete or replace the
> Instruction while completely ignoring attached MDNode.
> NamedMDNode is a simple collection of metadata nodes at module level. By
> design NamedMDNode does not have any uses and it can not directly hold any
> values (use any values)  other then MDNode, so there is not any reason for
> optimizer to worry about it.

Thanks Devang, I think this reasoning helps me have a consistent model for
what is and isn't allowed when transforming metadata.

To touch on Bill's mail, I think one thing that would help this discussion
(and others I've had recently) is to get some of these semantics of
metadata written down in the LangRef so that we at least have a documented
set of rules to follow.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120124/be02cdd9/attachment.html>

More information about the cfe-dev mailing list