[PATCH] D31826: Emit less compiler optimization remarks in samplepgo to reduce a call to findCalleeFunctionSamples which is going to be refactored.
Dehao Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 10 11:52:35 PDT 2017
danielcdh created this revision.
Herald added a subscriber: fhahn.
Now the SamplePGO support is more stable, we do not need so many verbose optimization remarks emitted.
https://reviews.llvm.org/D31826
Files:
lib/Transforms/IPO/SampleProfile.cpp
test/Transforms/SampleProfile/inline-coverage.ll
test/Transforms/SampleProfile/remarks.ll
Index: test/Transforms/SampleProfile/remarks.ll
===================================================================
--- test/Transforms/SampleProfile/remarks.ll
+++ test/Transforms/SampleProfile/remarks.ll
@@ -19,7 +19,7 @@
; We are expecting foo() to be inlined in main() (almost all the cycles are
; spent inside foo).
-; CHECK: remark: remarks.cc:13:21: inlined hot callee '_Z3foov' with 623868 samples into 'main'
+; CHECK: remark: remarks.cc:13:21: inlined hot callee '_Z3foov' into 'main'
; The back edge for the loop is the hottest edge in the loop subgraph.
; CHECK: remark: remarks.cc:6:9: most popular destination for conditional branches at remarks.cc:5:3
Index: test/Transforms/SampleProfile/inline-coverage.ll
===================================================================
--- test/Transforms/SampleProfile/inline-coverage.ll
+++ test/Transforms/SampleProfile/inline-coverage.ll
@@ -16,7 +16,7 @@
; 11 return sum > 0 ? 0 : 1;
; 12 }
;
-; CHECK: remark: coverage.cc:10:12: inlined hot callee '_Z3fool' with 172746 samples into 'main'
+; CHECK: remark: coverage.cc:10:12: inlined hot callee '_Z3fool' into 'main'
; CHECK: remark: coverage.cc:9:21: Applied 23478 samples from profile (offset: 2.1)
; CHECK: remark: coverage.cc:10:16: Applied 23478 samples from profile (offset: 3)
; CHECK: remark: coverage.cc:4:10: Applied 31878 samples from profile (offset: 1)
Index: lib/Transforms/IPO/SampleProfile.cpp
===================================================================
--- lib/Transforms/IPO/SampleProfile.cpp
+++ lib/Transforms/IPO/SampleProfile.cpp
@@ -664,13 +664,11 @@
continue;
}
DebugLoc DLoc = I->getDebugLoc();
- uint64_t NumSamples = findCalleeFunctionSamples(*I)->getTotalSamples();
if (InlineFunction(CallSite(DI), IFI)) {
LocalChanged = true;
emitOptimizationRemark(Ctx, DEBUG_TYPE, F, DLoc,
Twine("inlined hot callee '") +
- CalledFunction->getName() + "' with " +
- Twine(NumSamples) + " samples into '" +
+ CalledFunction->getName() + "' into '" +
F.getName() + "'");
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31826.94556.patch
Type: text/x-patch
Size: 2271 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170410/70c3df09/attachment.bin>
More information about the llvm-commits
mailing list