<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">DIBuilder and/or the constructors should be enforcing the limits on the non-enums like Args (and probably also the enums).<div class=""><br class=""></div><div class="">-- adrian<br class=""><div><blockquote type="cite" class=""><div class="">On Apr 8, 2016, at 11:11 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Certainly seems like a thing we might want to try - though it'd help to have a reminder/description of why shrinking these fields to these specific bit sizes is valid (are the already restricted to those sizes in other places/ways, for example - point to where/how they're already so restricted)</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Apr 8, 2016 at 7:08 PM, Davide Italiano via llvm-commits <span dir="ltr" class=""><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">davide created this revision.<br class="">
davide added reviewers: dexonsmith, aprantl, echristo, dblaikie.<br class="">
davide added a subscriber: llvm-commits.<br class="">
<br class="">
I started this effort after noticing that DI shows up as a considerable portion of memory usage during an LTO build (of clang, and others).<br class="">
This is roughly the data I got (peak usage):<br class="">
DISubprogram: 228MB<br class="">
DILocalVariable: 164MB<br class="">
The proposed patch packs field slightly more efficiently reducing the size of DISubprogram from 48bytes to 40bytes and of DILocalVariable from 40 bytes to 32 bytes.<br class="">
The saving overall in memory is ~70MB.<br class="">
This is still to be considered WIP as this breaks 4 tests in the LLVM suite (which I'm currently investigating), but I wanted to have some eyes on it as DebugInfo seems to be of interest of many these days.<br class="">
<br class="">
<a href="http://reviews.llvm.org/D18918" rel="noreferrer" target="_blank" class="">http://reviews.llvm.org/D18918</a><br class="">
<br class="">
Files:<br class="">
  include/llvm/IR/DebugInfoMetadata.h<br class="">
<br class="">
Index: include/llvm/IR/DebugInfoMetadata.h<br class="">
===================================================================<br class="">
--- include/llvm/IR/DebugInfoMetadata.h<br class="">
+++ include/llvm/IR/DebugInfoMetadata.h<br class="">
@@ -1229,21 +1229,21 @@<br class="">
<br class="">
   unsigned Line;<br class="">
   unsigned ScopeLine;<br class="">
-  unsigned Virtuality;<br class="">
   unsigned VirtualIndex;<br class="">
-  unsigned Flags;<br class="">
-  bool IsLocalToUnit;<br class="">
-  bool IsDefinition;<br class="">
-  bool IsOptimized;<br class="">
+  unsigned Virtuality:2;<br class="">
+  unsigned Flags:27;<br class="">
+  bool IsLocalToUnit:1;<br class="">
+  bool IsDefinition:1;<br class="">
+  bool IsOptimized:1;<br class="">
<br class="">
   DISubprogram(LLVMContext &C, StorageType Storage, unsigned Line,<br class="">
-               unsigned ScopeLine, unsigned Virtuality, unsigned VirtualIndex,<br class="">
+               unsigned ScopeLine, unsigned VirtualIndex, unsigned Virtuality,<br class="">
                unsigned Flags, bool IsLocalToUnit, bool IsDefinition,<br class="">
                bool IsOptimized, ArrayRef<Metadata *> Ops)<br class="">
       : DILocalScope(C, DISubprogramKind, Storage, dwarf::DW_TAG_subprogram,<br class="">
                      Ops),<br class="">
-        Line(Line), ScopeLine(ScopeLine), Virtuality(Virtuality),<br class="">
-        VirtualIndex(VirtualIndex), Flags(Flags), IsLocalToUnit(IsLocalToUnit),<br class="">
+        Line(Line), ScopeLine(ScopeLine), VirtualIndex(VirtualIndex),<br class="">
+        Virtuality(Virtuality), Flags(Flags), IsLocalToUnit(IsLocalToUnit),<br class="">
         IsDefinition(IsDefinition), IsOptimized(IsOptimized) {}<br class="">
   ~DISubprogram() = default;<br class="">
<br class="">
@@ -1858,8 +1858,8 @@<br class="">
   friend class LLVMContextImpl;<br class="">
   friend class MDNode;<br class="">
<br class="">
-  unsigned Arg;<br class="">
-  unsigned Flags;<br class="">
+  unsigned Arg:16;<br class="">
+  unsigned Flags:16;<br class="">
<br class="">
   DILocalVariable(LLVMContext &C, StorageType Storage, unsigned Line,<br class="">
                   unsigned Arg, unsigned Flags, ArrayRef<Metadata *> Ops)<br class="">
<br class="">
<br class="">
<br class="">_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>