<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 16, 2009, at 10:56 AM, Devang Patel wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><div><br>Is this new field copied by MetadataContextImpl::copyMD?<font class="Apple-style-span"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><div><div><br></div><div>The semantic is that if an MDNode is created function-local, then it will continue to be function-local even if its operands are modified to no longer refer to any function-specific IR.</div></div></div></div></blockquote><div><br></div><div>That'll break MDNode unique-ness.</div></span></blockquote><div><br></div>We don't guarantee MDNode uniqueness, we just endeavor to preserve it when it isn't "too hard".</div><div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div>Adding Function * in MDNode increases size of nodes and I anticipate that vast majority of nodes are not function local. A better approach is to let utility function isFunctionLocal() iterate  element and return respective Function *, if one or more elements are instructions.</div></span></blockquote><div><br></div><div>I agree.  MDNode should just have a *bit* that indicates whether it is function local (stored in SubclassData) and have a (slow) method that gets the Function* it is in by (recursively) walking the operands.  This method won't be called by much more than the verifier.</div><div><br></div><div>-Chris </div></div><br></body></html>