summaryrefslogtreecommitdiff
path: root/lib/profile/InstrProfData.inc
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-01-08 22:55:54 +0000
committerXinliang David Li <davidxl@google.com>2016-01-08 22:55:54 +0000
commit6ad1f2b89ae795158aa96558f06038ecb2fc4d4e (patch)
treedad165489aaceba5351e6ce4275e0d177e0e2eb3 /lib/profile/InstrProfData.inc
parentca3fff7b8c46e27247fe1ef813c51af6c5dda2a6 (diff)
[PGO] Introducing version mask macro/NFC (sync)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257225 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfData.inc')
-rw-r--r--lib/profile/InstrProfData.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/profile/InstrProfData.inc b/lib/profile/InstrProfData.inc
index 9fc4f546b..33c7d94ae 100644
--- a/lib/profile/InstrProfData.inc
+++ b/lib/profile/InstrProfData.inc
@@ -700,6 +700,14 @@ serializeValueProfDataFromRT(const ValueProfRuntimeRecord *Record,
#define INSTR_PROF_INDEX_VERSION 3
#define INSTR_PROF_COVMAP_VERSION 0
+/* Profile version is always of type uint_64_t. Reserve the upper 8 bits in the
+ * version for other variants of profile. We set the lowest bit of the upper 8
+ * bits (i.e. bit 56) to 1 to indicate if this is an IR-level instrumentaiton
+ * generated profile, and 0 if this is a Clang FE generated profile.
+*/
+#define VARIANT_MASKS_ALL 0xff00000000000000ULL
+#define GET_VERSION(V) ((V) & ~VARIANT_MASKS_ALL)
+
/* Runtime section names and name strings. */
#define INSTR_PROF_DATA_SECT_NAME __llvm_prf_data
#define INSTR_PROF_NAME_SECT_NAME __llvm_prf_names