<div dir="ltr">LGTM.  Apologies for the delayed review.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 10, 2017 at 2:52 PM, Dehao Chen via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">danielcdh created this revision.<br>
Herald added a subscriber: fhahn.<br>
<br>
Now the SamplePGO support is more stable, we do not need so many verbose optimization remarks emitted.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D31826" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D31826</a><br>
<br>
Files:<br>
  lib/Transforms/IPO/<wbr>SampleProfile.cpp<br>
  test/Transforms/SampleProfile/<wbr>inline-coverage.ll<br>
  test/Transforms/SampleProfile/<wbr>remarks.ll<br>
<br>
<br>
Index: test/Transforms/SampleProfile/<wbr>remarks.ll<br>
==============================<wbr>==============================<wbr>=======<br>
--- test/Transforms/SampleProfile/<wbr>remarks.ll<br>
+++ test/Transforms/SampleProfile/<wbr>remarks.ll<br>
@@ -19,7 +19,7 @@<br>
<br>
 ; We are expecting foo() to be inlined in main() (almost all the cycles are<br>
 ; spent inside foo).<br>
-; CHECK: remark: remarks.cc:13:21: inlined hot callee '_Z3foov' with 623868 samples into 'main'<br>
+; CHECK: remark: remarks.cc:13:21: inlined hot callee '_Z3foov' into 'main'<br>
<br>
 ; The back edge for the loop is the hottest edge in the loop subgraph.<br>
 ; CHECK: remark: remarks.cc:6:9: most popular destination for conditional branches at remarks.cc:5:3<br>
Index: test/Transforms/SampleProfile/<wbr>inline-coverage.ll<br>
==============================<wbr>==============================<wbr>=======<br>
--- test/Transforms/SampleProfile/<wbr>inline-coverage.ll<br>
+++ test/Transforms/SampleProfile/<wbr>inline-coverage.ll<br>
@@ -16,7 +16,7 @@<br>
 ;    11      return sum > 0 ? 0 : 1;<br>
 ;    12    }<br>
 ;<br>
-; CHECK: remark: coverage.cc:10:12: inlined hot callee '_Z3fool' with 172746 samples into 'main'<br>
+; CHECK: remark: coverage.cc:10:12: inlined hot callee '_Z3fool' into 'main'<br>
 ; CHECK: remark: coverage.cc:9:21: Applied 23478 samples from profile (offset: 2.1)<br>
 ; CHECK: remark: coverage.cc:10:16: Applied 23478 samples from profile (offset: 3)<br>
 ; CHECK: remark: coverage.cc:4:10: Applied 31878 samples from profile (offset: 1)<br>
Index: lib/Transforms/IPO/<wbr>SampleProfile.cpp<br>
==============================<wbr>==============================<wbr>=======<br>
--- lib/Transforms/IPO/<wbr>SampleProfile.cpp<br>
+++ lib/Transforms/IPO/<wbr>SampleProfile.cpp<br>
@@ -664,13 +664,11 @@<br>
         continue;<br>
       }<br>
       DebugLoc DLoc = I->getDebugLoc();<br>
-      uint64_t NumSamples = findCalleeFunctionSamples(*I)-<wbr>>getTotalSamples();<br>
       if (InlineFunction(CallSite(DI), IFI)) {<br>
         LocalChanged = true;<br>
         emitOptimizationRemark(Ctx, DEBUG_TYPE, F, DLoc,<br>
                                Twine("inlined hot callee '") +<br>
-                                   CalledFunction->getName() + "' with " +<br>
-                                   Twine(NumSamples) + " samples into '" +<br>
+                                   CalledFunction->getName() + "' into '" +<br>
                                    F.getName() + "'");<br>
       }<br>
     }<br>
<br>
<br>
</blockquote></div><br></div>