<div class="gmail_quote">On Tue, Jan 24, 2012 at 3:39 PM, Devang Patel <span dir="ltr"><<a href="mailto:dpatel@apple.com">dpatel@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>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. </div>
<div><br></div><div>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.</div>
<div class="im"><div></div></div></blockquote></div><br><div>Thanks Devang, I think this reasoning helps me have a consistent model for what is and isn't allowed when transforming metadata.</div><div><br></div><div>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.</div>