[llvm] r253893 - [PGO] Introduce alignment macro for instr-prof control data(NFC)

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 10:03:00 PST 2015


Author: davidxl
Date: Mon Nov 23 12:02:59 2015
New Revision: 253893

URL: http://llvm.org/viewvc/llvm-project?rev=253893&view=rev
Log:
[PGO] Introduce alignment macro for instr-prof control data(NFC)

Modified:
    llvm/trunk/include/llvm/ProfileData/InstrProfData.inc
    llvm/trunk/lib/Transforms/Instrumentation/InstrProfiling.cpp

Modified: llvm/trunk/include/llvm/ProfileData/InstrProfData.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/InstrProfData.inc?rev=253893&r1=253892&r2=253893&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/InstrProfData.inc (original)
+++ llvm/trunk/include/llvm/ProfileData/InstrProfData.inc Mon Nov 23 12:02:59 2015
@@ -183,7 +183,6 @@ COVMAP_FUNC_RECORD(const uint64_t, llvm:
 #define INSTR_PROF_SIMPLE_CONCAT(x,y) x ## y
 #define INSTR_PROF_CONCAT(x,y) INSTR_PROF_SIMPLE_CONCAT(x,y)
 
-
 /* Magic number to detect file format and endianness.
  * Use 255 at one end, since no UTF-8 file can use that character.  Avoid 0,             
  * so that utilities, like strings, don't grab it as a string.  129 is also              
@@ -230,6 +229,9 @@ COVMAP_FUNC_RECORD(const uint64_t, llvm:
 #define INSTR_PROF_VALUE_PROF_FUNC_STR \
         INSTR_PROF_QUOTE(INSTR_PROF_VALUE_PROF_FUNC)
 
+/* InstrProfile per-function control data alignment.  */
+#define INSTR_PROF_DATA_ALIGNMENT 8
+
 /* The data structure that represents a tracked value by the
  * value profiler.
  */

Modified: llvm/trunk/lib/Transforms/Instrumentation/InstrProfiling.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/InstrProfiling.cpp?rev=253893&r1=253892&r2=253893&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/InstrProfiling.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/InstrProfiling.cpp Mon Nov 23 12:02:59 2015
@@ -344,7 +344,7 @@ InstrProfiling::getOrCreateRegionCounter
                                   getVarName(Inc, getInstrProfDataVarPrefix()));
   Data->setVisibility(NamePtr->getVisibility());
   Data->setSection(getDataSection());
-  Data->setAlignment(8);
+  Data->setAlignment(INSTR_PROF_DATA_ALIGNMENT);
   Data->setComdat(ProfileVarsComdat);
 
   PD.RegionCounters = CounterPtr;




More information about the llvm-commits mailing list