<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Jun 29, 2017 at 3:20 PM David Li via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">davidxl added inline comments.<br>
<br>
<br>
================<br>
Comment at: include/llvm/ProfileData/InstrProf.h:600<br>
+  };<br>
+  struct CounterHolder {<br>
+    std::vector<uint64_t> Counts;<br>
----------------<br>
nit: maybe just Counters?  Holder does not provide additional information.<br></blockquote></div><div dir="ltr"><div class="gmail_quote"><div><br>Then it's the same name as the field (happy to rename that too, though) which causes problems when trying to name the type (InstrProfRecord::Counters no longer refers to the type, but is a member data pointer expression (well, if you put '&' before it, or maybe that's optional, I forget)).<br><br>Certainly open to ideas.<br> </div></div></div><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
================<br>
Comment at: lib/ProfileData/InstrProf.cpp:504<br>
   if (ThisNumValueSites != OtherNumValueSites) {<br>
-    SIPE.addError(instrprof_error::value_site_count_mismatch);<br>
+    // SIPE.addError(instrprof_error::value_site_count_mismatch);<br>
     return;<br>
----------------<br>
Keep this until the discussion about its fate is resolved.<br></blockquote></div></div><div dir="ltr"><div class="gmail_quote"><div><br>Good point - that these changes are independent but complementary. I've updated this patch to preserve the current SoftInstrProfError handling.<br><br>This brings the memory savings down (this change brings memory usage from 10GB to 8GB, removing the SoftInstrProfError will bring that down further to 5GB), but still demonstrable/justified.<br> </div></div></div><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
================<br>
Comment at: lib/ProfileData/InstrProfWriter.cpp:152<br>
+              .second; // FIXME: Avoid copying by fixing the addRecord API<br>
+      SummaryBuilder->addRecord(std::move(R));<br>
<br>
----------------<br>
Summary Builder does not need name, hash etc. so perfhaps fixing API is the right way.<br></blockquote></div></div><div dir="ltr"><div class="gmail_quote"><div><br>Ah, thanks for catching that - done!<br><br>(updated with the CR feedback addressed & got the tests all passing with a few fixes, etc)<br><br>- Dave<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<a href="https://reviews.llvm.org/D34838" rel="noreferrer" target="_blank">https://reviews.llvm.org/D34838</a><br>
<br>
<br>
<br>
</blockquote></div></div></div>