[PATCH] D55660: [SampleFDO] handle ProfileSampleAccurate when initializing function entry count

Easwaran Raman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 13 10:31:47 PST 2018


eraman added a comment.

Could you add  a test case or augment an existing test to check that the function entry count is 0 if -sample-profile and -profile-sample-accurate is specified?



================
Comment at: lib/Transforms/IPO/SampleProfile.cpp:129
+    cl::desc("If the sample profile is accurate, we will mark all un-sampled "
+             "callsite and function as cold. Otherwise, treat un-sampled "
+             "callsites and functions as if they are newly added so we have "
----------------
To be more precise, you are now marking all un-sampled functions as having entry count 0 (not just cold) 


================
Comment at: test/Transforms/SampleProfile/inline-cold-callsite-samplepgo.ll:7
+
+define i32 @callee(i32 %x) {
+  %x1 = add i32 %x, 1
----------------
Nit: You probably just need a  single call void @extern() in the body to make this not inlineable when threshold is 0. 


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55660/new/

https://reviews.llvm.org/D55660





More information about the llvm-commits mailing list