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

Profile merging is not supported when using debug info profile
correlation because the data section won't be in the binary at runtime.
Change the default profile name in this mode to `default_%p.proflite` so
we don't use profile merging.

Reviewed By: kyulee

Differential Revision: https://reviews.llvm.org/D115979
This commit is contained in:
Ellis Hoag 2021-12-20 09:47:32 -08:00
parent 19727e31fb
commit ac719d7c9a
2 changed files with 7 additions and 2 deletions

View File

@ -102,7 +102,7 @@ namespace {
// 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 {

View File

@ -95,8 +95,13 @@ static uintptr_t signextIfWin64(void *V) {
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;