<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Oct 11, 2013 at 12:40 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">>> It depends upon the goals. If the goal is to make debug information<br>
>> post-link smaller then just using the type hashing machinery for<br>
>> structs will be sufficient.<br>
><br>
><br>
> By "the type hashing machinery for structs", are you referring to the type<br>
> hashing at the back end?<br>
><br>
<br>
</div>I am, yes, since there's no other place we do currently.<br>
<div class="im"><br>
>><br>
>> However, if it's to save space during an<br>
>> LTO link then we'll want to do it in the front end.<br>
><br>
><br>
> Yes, my purpose here is to save memory space in number of MDNodes (also # of<br>
> DIEs) generated in a LTO build.<br>
> Type hashing at the DIE level can reduce the dwarf size.<br>
><br>
<br>
</div>I agree with both of these statements.<br>
<br>
I also agree with the desire to help LTO memory consumption so we'll<br>
need something from the front end for this since we'd like to continue<br>
to use the folding set to do the uniquing.<br></blockquote><div><br></div><div>Hi Eric,</div><div><br></div><div>Assume that we need to do type hashing (i.e. assume Doug's rules for merging C types do not apply), would you</div>
<div>like it to be done on AST types or IR debug info metadata types?</div><div><br></div><div>One possibility is to hash the IR debug info types in DIBuilder::finalize.</div><div>When we are creating the MD nodes, we can provide a simple identifier that is unique within the DIBuider. In finailize(),</div>
<div>we update the identifier to include a hash value (prepend the type name), so types constructed by one DIBuilder will be unique</div><div>from types constructed by another DIBUilder unless they are structurally equivalent by having the same hash.</div>
<div><br></div><div>We can then use the folding set to do the uniquing across CUs.</div><div><br></div><div>Thanks,</div><div>Manman <br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<span class="HOEnZb"><font color="#888888"><br>
-eric<br>
</font></span></blockquote></div><br></div></div>