[PATCH] D115642: [CSSPGO] Warn instead of error out for modules that are not probed.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 13 09:25:44 PST 2021


hoy created this revision.
Herald added subscribers: ormris, modimo, wenlei, hiraditya.
hoy requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Modules that are not compiled with pseudo probe enabled can reference functions that are probed, cause those functions imported into the non-probed module. In this case we should warn instead of error out when loading the profiles for imported probed functions.

Test Plan:


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115642

Files:
  llvm/lib/Transforms/IPO/SampleProfile.cpp


Index: llvm/lib/Transforms/IPO/SampleProfile.cpp
===================================================================
--- llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -2015,7 +2015,8 @@
     if (!ProbeManager->moduleIsProbed(M)) {
       const char *Msg =
           "Pseudo-probe-based profile requires SampleProfileProbePass";
-      Ctx.diagnose(DiagnosticInfoSampleProfile(Filename, Msg));
+      Ctx.diagnose(DiagnosticInfoSampleProfile(M.getModuleIdentifier(), Msg,
+                                               DS_Warning));
       return false;
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115642.393924.patch
Type: text/x-patch
Size: 612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211213/b11f289a/attachment.bin>


More information about the llvm-commits mailing list