[PATCH] D115979: [InstrProf] Don't profile merge by default in lightweight mode

Ellis Hoag via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 20 09:50:48 PST 2021


ellis updated this revision to Diff 395481.
ellis added a comment.

Expand warning message


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115979

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  compiler-rt/lib/profile/InstrProfilingMerge.c


Index: compiler-rt/lib/profile/InstrProfilingMerge.c
===================================================================
--- compiler-rt/lib/profile/InstrProfilingMerge.c
+++ compiler-rt/lib/profile/InstrProfilingMerge.c
@@ -95,8 +95,13 @@
 COMPILER_RT_VISIBILITY
 int __llvm_profile_merge_from_buffer(const char *ProfileData,
                                      uint64_t ProfileSize) {
-  if (__llvm_profile_get_version() & VARIANT_MASK_DBG_CORRELATE)
+  if (__llvm_profile_get_version() & VARIANT_MASK_DBG_CORRELATE) {
+    PROF_ERR(
+        "%s\n",
+        "Debug info correlation does not support profile merging at runtime. "
+        "Instead, merge raw profiles using the llvm-profdata tool.");
     return 1;
+  }
 
   __llvm_profile_data *SrcDataStart, *SrcDataEnd, *SrcData, *DstData;
   __llvm_profile_header *Header = (__llvm_profile_header *)ProfileData;
Index: clang/lib/CodeGen/BackendUtil.cpp
===================================================================
--- clang/lib/CodeGen/BackendUtil.cpp
+++ clang/lib/CodeGen/BackendUtil.cpp
@@ -102,7 +102,7 @@
 
 // Default filename used for profile generation.
 std::string getDefaultProfileGenName() {
-  return DebugInfoCorrelate ? "default_%m.proflite" : "default_%m.profraw";
+  return DebugInfoCorrelate ? "default_%p.proflite" : "default_%m.profraw";
 }
 
 class EmitAssemblyHelper {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115979.395481.patch
Type: text/x-patch
Size: 1358 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211220/69179255/attachment.bin>


More information about the cfe-commits mailing list