[PATCH] D61609: [llvm] Handle missing debug info when updating sample counts

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 6 20:35:06 PDT 2019


davidxl added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:1667
+
+  if (WantAccurateProfile && getFunctionLoc(F) == 0) {
+    // We won't be able to match samples. Reset all !prof metadata.
----------------
why 'WantAccurateProfile' guard?


================
Comment at: llvm/test/Transforms/SampleProfile/entry_counts_missing_dbginfo.ll:7
+; - we don't have debug info for the function. This means we can't match sample counts in the profile to locations in this function.
+; When this function is not inlined, we'll attempt to update its profile info, as well as that of calls within the function.
+; This would result in a div by 0, unless we handle this scenario.
----------------
Needs clarification. When the function is not inlined, why is there need to update its profile? Can you point to the compiler source that does this?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61609





More information about the llvm-commits mailing list