[PATCH] D34082: [Frontend 'Show hotness' can be used with a sampling profile

David Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 10 11:43:26 PDT 2017


davidxl added inline comments.


================
Comment at: test/Frontend/optimization-remark-with-hotness.c:32
+// RUN:     -Rpass-analysis=inline -fdiagnostics-show-hotness  2>&1 | FileCheck \
+// RUN:     -check-prefix=PGO_ENABLED %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \
----------------
anemet wrote:
> modocache wrote:
> > Ideally, I'd like for this test to be identical to the ones that use `-verify` above, save for using `-fprofile-sample-use`. However I couldn't figure out how to write `optimization-remark-with-hotness-sample.proftext` such that it would produce hotness info for each of the functions. I'm able to confirm, using real sampling from another program of mine, that remarks using AutoFDO data do indeed show hotness, but this test does not verify this in its current state.
> > 
> > Any advice here? I wrote `optimization-remark-with-hotness-sample.proftext` based on the format specified in https://clang.llvm.org/docs/UsersManual.html#sample-profile-text-format, but maybe it's missing something that would allow hotness to be displayed?
> I don't have any immediate ideas since I am not familiar with sample-based profiling unfortunately.  I will study this later unless you beat me to it or David has some ideas.
The hotness is based on profile summary, so you need to adjust the bar's entry count and inline instance of foo's count to be  very large value to let compiler decide it is hot.


https://reviews.llvm.org/D34082





More information about the cfe-commits mailing list