<div dir="ltr">Dynamically choosing form based on usage isn't something that's been done in LLVM's DWARF emission thus far and would probably be a significant amount of work to implement. (I don't really recommend it)<br><br>But the way the existing similar support for DW_FORM_flag_present works is that it's explicitly chosen when creating the attributes/DIEs - it might be that by collecting some data you could show that most values for certain attributes on certain DIEs share the same value and then explicitly construct those using implicit_const always, rather than conditionally. (eg: maybe the private/public part of member descriptions could always be emitted with implicit_const)<br><br>This sort of hardcoded heuristic approach of course will not always yield optimal results but might have some gains.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 10, 2020 at 11:24 PM Sourabh Singh Tomar via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><br></div><div class="gmail_attr">Forwarding to Mailing list.</div><div dir="ltr">Hello Everyone,<div><br></div><div>I'm trying to implement DW_FORM_implicit_const as an experimental feature to evaluate its gain in the overall size reduction in debug info.</div><div><br></div><div>In my initial implementation, DW_FORM_implicit_const is emitted only when a *constant* attribute is same across multiple DIE's.</div><div><br></div><div>This is accomplished, in process of *uniquing* of Abbrevs i.e if an Abbrev is duplicate that suggests it's shared by multiple DIE's, so we replaced the constant attributes[DW_AT_decl_file] {value, form}  with DW_FORM_implicit_const in corresponding Abbrev.</div><div><br></div><div>The problem I'm facing, is in deletion of  the attribute[DW_AT_decl_file] from DIE's[debug_info] that are using this abbrev.  These DIE's are laid out as DIEValueList, Is there a way to cleanly remove a node[Attribute] from this list ??</div><div><br></div><div>Can anybody share comments/thoughts on the implementation side of this and suggest  how to overcome the deletion of attributes from the DIEs in the debug_info section.</div><div><div><br></div><div>Thank You, </div><div>Sourabh.</div></div></div>
</div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>