@@ -76,6 +76,7 @@ INSTR_PROF_DATA(const uint64_t, llvm::Type::getInt64Ty(Ctx), FuncHash, \
7676 ConstantInt::get(llvm::Type::getInt64Ty(Ctx), \
7777 Inc->getHash()->getZExtValue()))
7878INSTR_PROF_DATA(const IntPtrT, IntPtrTy, CounterPtr, RelativeCounterPtr)
79+ INSTR_PROF_DATA(const IntPtrT, IntPtrTy, BitmapPtr, RelativeBitmapPtr)
7980/* This is used to map function pointers for the indirect call targets to
8081 * function name hashes during the conversion from raw to merged profile
8182 * data.
@@ -87,7 +88,9 @@ INSTR_PROF_DATA(IntPtrT, llvm::Type::getInt8PtrTy(Ctx), Values, \
8788INSTR_PROF_DATA(const uint32_t , llvm::Type::getInt32Ty(Ctx), NumCounters, \
8889 ConstantInt::get(llvm::Type::getInt32Ty(Ctx), NumCounters))
8990INSTR_PROF_DATA(const uint16_t , Int16ArrayTy, NumValueSites[IPVK_Last+1 ], \
90- ConstantArray::get (Int16ArrayTy, Int16ArrayVals))
91+ ConstantArray::get (Int16ArrayTy, Int16ArrayVals)) \
92+ INSTR_PROF_DATA(const uint32_t , llvm::Type::getInt32Ty(Ctx), NumBitmapBytes, \
93+ ConstantInt::get(llvm::Type::getInt32Ty(Ctx), NumBitmapBytes))
9194#undef INSTR_PROF_DATA
9295/* INSTR_PROF_DATA end. */
9396
@@ -132,9 +135,13 @@ INSTR_PROF_RAW_HEADER(uint64_t, NumData, NumData)
132135INSTR_PROF_RAW_HEADER(uint64_t , PaddingBytesBeforeCounters, PaddingBytesBeforeCounters)
133136INSTR_PROF_RAW_HEADER(uint64_t , NumCounters, NumCounters)
134137INSTR_PROF_RAW_HEADER(uint64_t , PaddingBytesAfterCounters, PaddingBytesAfterCounters)
138+ INSTR_PROF_RAW_HEADER(uint64_t , NumBitmapBytes, NumBitmapBytes)
139+ INSTR_PROF_RAW_HEADER(uint64_t , PaddingBytesAfterBitmapBytes, PaddingBytesAfterBitmapBytes)
135140INSTR_PROF_RAW_HEADER(uint64_t , NamesSize, NamesSize)
136141INSTR_PROF_RAW_HEADER(uint64_t , CountersDelta,
137142 (uintptr_t )CountersBegin - (uintptr_t )DataBegin)
143+ INSTR_PROF_RAW_HEADER(uint64_t , BitmapDelta,
144+ (uintptr_t )BitmapBegin - (uintptr_t )DataBegin)
138145INSTR_PROF_RAW_HEADER(uint64_t , NamesDelta, (uintptr_t )NamesBegin)
139146INSTR_PROF_RAW_HEADER(uint64_t , ValueKindLast, IPVK_Last)
140147#undef INSTR_PROF_RAW_HEADER
@@ -267,6 +274,9 @@ INSTR_PROF_SECT_ENTRY(IPSK_data, \
267274INSTR_PROF_SECT_ENTRY(IPSK_cnts, \
268275 INSTR_PROF_QUOTE (INSTR_PROF_CNTS_COMMON), \
269276 INSTR_PROF_CNTS_COFF, "__DATA,")
277+ INSTR_PROF_SECT_ENTRY(IPSK_bitmap, \
278+ INSTR_PROF_QUOTE (INSTR_PROF_BITS_COMMON), \
279+ INSTR_PROF_BITS_COFF, "__DATA,")
270280INSTR_PROF_SECT_ENTRY(IPSK_name, \
271281 INSTR_PROF_QUOTE (INSTR_PROF_NAME_COMMON), \
272282 INSTR_PROF_NAME_COFF, "__DATA,")
@@ -645,11 +655,11 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
645655 (uint64_t )' f' << 16 | (uint64_t )' R' << 8 | (uint64_t )129
646656
647657/* Raw profile format version (start from 1). */
648- #define INSTR_PROF_RAW_VERSION 8
658+ #define INSTR_PROF_RAW_VERSION 9
649659/* Indexed profile format version (start from 1). */
650- #define INSTR_PROF_INDEX_VERSION 10
660+ #define INSTR_PROF_INDEX_VERSION 11
651661/* Coverage mapping format version (start from 0). */
652- #define INSTR_PROF_COVMAP_VERSION 5
662+ #define INSTR_PROF_COVMAP_VERSION 6
653663
654664/* Profile version is always of type uint64_t. Reserve the upper 32 bits in the
655665 * version for other variants of profile. We set the 8th most significant bit
@@ -686,6 +696,7 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
686696#define INSTR_PROF_DATA_COMMON __llvm_prf_data
687697#define INSTR_PROF_NAME_COMMON __llvm_prf_names
688698#define INSTR_PROF_CNTS_COMMON __llvm_prf_cnts
699+ #define INSTR_PROF_BITS_COMMON __llvm_prf_bits
689700#define INSTR_PROF_VALS_COMMON __llvm_prf_vals
690701#define INSTR_PROF_VNODES_COMMON __llvm_prf_vnds
691702#define INSTR_PROF_COVMAP_COMMON __llvm_covmap
@@ -697,6 +708,7 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
697708#define INSTR_PROF_DATA_COFF " .lprfd$M"
698709#define INSTR_PROF_NAME_COFF " .lprfn$M"
699710#define INSTR_PROF_CNTS_COFF " .lprfc$M"
711+ #define INSTR_PROF_BITS_COFF " .lprfb$M"
700712#define INSTR_PROF_VALS_COFF " .lprfv$M"
701713#define INSTR_PROF_VNODES_COFF " .lprfnd$M"
702714#define INSTR_PROF_COVMAP_COFF " .lcovmap$M"
@@ -708,6 +720,7 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
708720#define INSTR_PROF_DATA_SECT_NAME INSTR_PROF_DATA_COFF
709721#define INSTR_PROF_NAME_SECT_NAME INSTR_PROF_NAME_COFF
710722#define INSTR_PROF_CNTS_SECT_NAME INSTR_PROF_CNTS_COFF
723+ #define INSTR_PROF_BITS_SECT_NAME INSTR_PROF_BITS_COFF
711724/* Array of pointers. Each pointer points to a list
712725 * of value nodes associated with one value site.
713726 */
@@ -722,6 +735,7 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
722735#define INSTR_PROF_DATA_SECT_NAME INSTR_PROF_QUOTE (INSTR_PROF_DATA_COMMON)
723736#define INSTR_PROF_NAME_SECT_NAME INSTR_PROF_QUOTE (INSTR_PROF_NAME_COMMON)
724737#define INSTR_PROF_CNTS_SECT_NAME INSTR_PROF_QUOTE (INSTR_PROF_CNTS_COMMON)
738+ #define INSTR_PROF_BITS_SECT_NAME INSTR_PROF_QUOTE (INSTR_PROF_BITS_COMMON)
725739/* Array of pointers. Each pointer points to a list
726740 * of value nodes associated with one value site.
727741 */
0 commit comments