Skip to content

Commit 1df7289

Browse files
[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
1 parent 03d8bc1 commit 1df7289

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler-rt/lib/profile/InstrProfilingMerge.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ uint64_t lprofGetLoadModuleSignature() {
3434
const __llvm_profile_data *FirstD = __llvm_profile_begin_data();
3535

3636
return (NamesSize << 40) + (CounterSize << 30) + (DataSize << 20) +
37-
(NumVnodes << 10) + (DataSize > 0 ? FirstD->NameRef : 0) + Version;
37+
(NumVnodes << 10) + (DataSize > 0 ? FirstD->NameRef : 0) + Version +
38+
__llvm_profile_get_magic();
3839
}
3940

4041
/* Returns 1 if profile is not structurally compatible. */

0 commit comments

Comments
 (0)