[compiler-rt] 1df7289 - [compiler-rt/profile] Include __llvm_profile_get_magic in module signature

Pirama Arumuga Nainar via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 23 10:10:38 PST 2021


Author: Pirama Arumuga Nainar
Date: 2021-11-23T10:03:43-08:00
New Revision: 1df7289af66c630480a676e2a5347dca5a3ede15

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

LOG: [compiler-rt/profile] Include __llvm_profile_get_magic in module signature

The INSTR_PROF_RAW_MAGIC_* number in profraw files should match during
profile merging.  This causes an error with 32-bit and 64-bit variants
of the same code.  The module signatures for the two binaries are
identical but they use different INSTR_PROF_RAW_MAGIC_* causing a
failure when profile-merging is used.  Including it when computing the
module signature yields different signatures for the 32-bit and 64-bit
profiles.

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

Added: 
    

Modified: 
    compiler-rt/lib/profile/InstrProfilingMerge.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/profile/InstrProfilingMerge.c b/compiler-rt/lib/profile/InstrProfilingMerge.c
index 674b1898b0469..80db2527461e4 100644
--- a/compiler-rt/lib/profile/InstrProfilingMerge.c
+++ b/compiler-rt/lib/profile/InstrProfilingMerge.c
@@ -34,7 +34,8 @@ uint64_t lprofGetLoadModuleSignature() {
   const __llvm_profile_data *FirstD = __llvm_profile_begin_data();
 
   return (NamesSize << 40) + (CounterSize << 30) + (DataSize << 20) +
-         (NumVnodes << 10) + (DataSize > 0 ? FirstD->NameRef : 0) + Version;
+         (NumVnodes << 10) + (DataSize > 0 ? FirstD->NameRef : 0) + Version +
+         __llvm_profile_get_magic();
 }
 
 /* Returns 1 if profile is not structurally compatible.  */


        


More information about the llvm-commits mailing list