<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 6, 2016, at 2:29 PM, Pete Cooper via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">+1 or attaching metadata to globals. I’d be curious if we can attach !range to a global representing an enum for example. But…<div class=""><div class=""><br class=""></div><div class="">Should we care about GlobalMerge for !dbg here? Currently if we merge globals ‘a’ and ‘b’ in to __merged_global, i guess the DIGlobalVariable’s for ‘a’ and ‘b’ would now both point to the new __merged_global.</div><div class=""><br class=""></div><div class="">If thats the case, then by having the !dbg on the global, we wouldn’t be able to handle this case, unless you allow the !dbg to (optionally) point to a list of DIGlobalVariable’s.</div></div></div></div></blockquote><div><br class=""></div><div>Users seem to care. I did receive several independent bug reports about LLVM not handling debug info for global merge even before this change, so I definitely want to at least have a story for supporting it before we proceed.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class="">BTW, this isn’t something I think should block this bug, but just wanted to point out that it could be an issue. MergeFunction’s likely has a similar issue with !dbg on functions and I guess we don’t handle it there either.</div><div class=""><br class=""></div><div class="">Cheers</div><div class="">Pete</div><div class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="">On May 6, 2016, at 2:23 PM, Philip Reames via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" class="">
<div text="#000000" bgcolor="#FFFFFF" class="">
+1. I've seen a couple of cases where metadata on a global would be
useful as an optimization hint as well. <br class="">
<br class="">
Philip<br class="">
<br class="">
<div class="moz-cite-prefix">On 05/06/2016 01:17 PM, Peter
Collingbourne via llvm-dev wrote:<br class="">
</div>
<blockquote cite="mid:CAPQLkRjj3kp9Z_fi1Be4-UB18WvT18A26okhcBfxaK_jCUyBMQ@mail.gmail.com" type="cite" class="">
<div dir="ltr" class="">Hi all,
<div class=""><br class="">
</div>
<div class="">I'd like to add support for metadata attachments for global
variables in the same way as we did for functions.</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">Syntax would be pretty simple:</div>
<div class="">@foo = global i32 0, !foo !0, !bar !1</div>
<div class="">(the extra commas are required to disambiguate from a
named metadata on the next line)</div>
</div>
<div class=""><br class="">
</div>
<div class="">Benefits:</div>
<div class="">1) Lets us reverse the DIGlobalVariable ->
GlobalVariable edge, which should hopefully clear the way for
removing the <a moz-do-not-send="true" href="http://llvm.dbg.cu/" class="">llvm.dbg.cu</a> named metadata
node.</div>
<div class=""><br class="">
</div>
<div class="">2) Allows for bitset metadata to be attached to globals
rather than being represented as a named metadata node. This
means that bitset metadata is naturally dropped when globals
are dropped, and makes it easier to manipulate bitset metadata
and build summaries of bitset definitions.</div>
<div class=""><br class="">
</div>
<div class="">Comments appreciated.</div>
<div class=""><br class="">
</div>
<div class="">Thanks,<br class="">
-- <br class="">
<div class="">
<div dir="ltr" class="">--
<div class="">Peter</div>
</div>
</div>
</div>
</div>
<br class="">
<fieldset class="mimeAttachmentHeader"></fieldset>
<br class="">
<pre wrap="" class="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<br class="">
</div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class=""></div></blockquote></div><br class=""></div></div></div></div>_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>