[PATCH] D45377: [SampleFDO] Don't let inliner treat warm callsite with inline instance in the profile as cold

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 11 09:35:23 PDT 2018


davidxl added inline comments.


================
Comment at: lib/Analysis/ProfileSummaryInfo.cpp:252
   return (hasSampleProfile() &&
-          (CS.getCaller()->hasProfileData() || ProfileSampleAccurate ||
+          (ProfileSampleAccurate ||
            CS.getCaller()->hasFnAttribute("profile-sample-accurate")));
----------------
This can cause problem if the caller function is newly added and there is no profile associated with it -- all callsites there will be marked as cold.


================
Comment at: lib/Transforms/IPO/SampleProfile.cpp:1300
+        // so that regular inliner will not treat it as cold.
+        if (BlockWeights[BB] == 0 && WarmCallsWithoutProf.count(&I))
+          continue;
----------------
Instead of skipping it, is it better to annotate it with a 'warm' profile count?


Repository:
  rL LLVM

https://reviews.llvm.org/D45377





More information about the llvm-commits mailing list