[llvm] d7b7b64 - [CSSPGO] Warn instead of error out for modules that are not probed.

Hongtao Yu via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 14 16:39:02 PST 2021


Author: Hongtao Yu
Date: 2021-12-14T16:38:50-08:00
New Revision: d7b7b6491445ca8953dfec4fb15f8605ef362a67

URL: https://github.com/llvm/llvm-project/commit/d7b7b6491445ca8953dfec4fb15f8605ef362a67
DIFF: https://github.com/llvm/llvm-project/commit/d7b7b6491445ca8953dfec4fb15f8605ef362a67.diff

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

Modules that are not compiled with pseudo probe enabled can still be compiled with a sample profile input, such as in LTO postlink where other modules are probed. Since the profile is unrelated to the current modules, we should warn instead of error out the compilation.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D115642

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp
index 7c01909cbc2ba..d57c504553a30 100644
--- a/llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -2015,7 +2015,8 @@ bool SampleProfileLoader::doInitialization(Module &M,
     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;
     }
   }


        


More information about the llvm-commits mailing list