Skip to content

Commit 24c615f

Browse files
committed
[InstrProfData] Bump the raw profile version to 8
This is to account for the change that made CountersPtr in __profd_ relative which landed in a1532ed. That change hasn't updated the raw profile version, and while the profile layout stayed the same, profiles generated by tip-of-tree LLVM are incompatible with 13.x tooling. Differential Revision: https://reviews.llvm.org/D111123
1 parent 0c14e27 commit 24c615f

15 files changed

+14
-13
lines changed

compiler-rt/include/profile/InstrProfData.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
645645
(uint64_t)'f' << 16 | (uint64_t)'R' << 8 | (uint64_t)129
646646

647647
/* Raw profile format version (start from 1). */
648-
#define INSTR_PROF_RAW_VERSION 7
648+
#define INSTR_PROF_RAW_VERSION 8
649649
/* Indexed profile format version (start from 1). */
650650
#define INSTR_PROF_INDEX_VERSION 7
651651
/* Coverage mapping format version (start from 0). */

llvm/include/llvm/ProfileData/InstrProf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,7 @@ namespace RawInstrProf {
11051105
// sensitive records.
11061106
// Version 6: Added binary id.
11071107
// Version 7: Reorder binary id and include version in signature.
1108+
// Version 8: Use relative counter pointer.
11081109
const uint64_t Version = INSTR_PROF_RAW_VERSION;
11091110

11101111
template <class IntPtrT> inline uint64_t getMagic();

llvm/include/llvm/ProfileData/InstrProfData.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
645645
(uint64_t)'f' << 16 | (uint64_t)'R' << 8 | (uint64_t)129
646646

647647
/* Raw profile format version (start from 1). */
648-
#define INSTR_PROF_RAW_VERSION 7
648+
#define INSTR_PROF_RAW_VERSION 8
649649
/* Indexed profile format version (start from 1). */
650650
#define INSTR_PROF_INDEX_VERSION 7
651651
/* Coverage mapping format version (start from 0). */
-16 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

llvm/test/tools/llvm-profdata/binary-ids-padding.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// INSTR_PROF_RAW_HEADER(uint64_t, ValueKindLast, IPVK_Last)
1212

1313
RUN: printf '\201rforpl\377' > %t.profraw
14-
RUN: printf '\7\0\0\0\0\0\0\0' >> %t.profraw
14+
RUN: printf '\10\0\0\0\0\0\0\0' >> %t.profraw
1515
// There will be 2 20-byte binary IDs, so the total Binary IDs size will be 64 bytes.
1616
// 2 * 8 binary ID sizes
1717
// + 2 * 20 binary IDs (of size 20)

llvm/test/tools/llvm-profdata/insufficient-binary-ids-size.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
RUN: printf '\201rforpl\377' > %t.profraw
2-
RUN: printf '\7\0\0\0\0\0\0\0' >> %t.profraw
2+
RUN: printf '\10\0\0\0\0\0\0\0' >> %t.profraw
33
// We should fail on this because the data buffer (profraw file) is not long
44
// enough to hold this binary IDs size. NOTE that this (combined with the 8-byte
55
// alignment requirement for binary IDs size) will ensure we can at least read one

llvm/test/tools/llvm-profdata/large-binary-id-size.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
RUN: printf '\201rforpl\377' > %t.profraw
2-
RUN: printf '\7\0\0\0\0\0\0\0' >> %t.profraw
2+
RUN: printf '\10\0\0\0\0\0\0\0' >> %t.profraw
33
RUN: printf '\40\0\0\0\0\0\0\0' >> %t.profraw
44
RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
55
RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw

llvm/test/tools/llvm-profdata/malformed-ptr-to-counter-array.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// INSTR_PROF_RAW_HEADER(uint64_t, ValueKindLast, IPVK_Last)
1212

1313
RUN: printf '\201rforpl\377' > %t.profraw
14-
RUN: printf '\7\0\0\0\0\0\0\0' >> %t.profraw
14+
RUN: printf '\10\0\0\0\0\0\0\0' >> %t.profraw
1515
RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
1616
RUN: printf '\1\0\0\0\0\0\0\0' >> %t.profraw
1717
RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw

llvm/test/tools/llvm-profdata/misaligned-binary-ids-size.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
RUN: printf '\201rforpl\377' > %t.profraw
2-
RUN: printf '\7\0\0\0\0\0\0\0' >> %t.profraw
2+
RUN: printf '\10\0\0\0\0\0\0\0' >> %t.profraw
33
// We should fail on this because the binary IDs is not a multiple of 8 bytes.
44
RUN: printf '\77\0\0\0\0\0\0\0' >> %t.profraw
55
RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw

0 commit comments

Comments
 (0)