@@ -105,8 +105,8 @@ inline uint64_t getInstrMaxCountValue() {
105105// / \p AddSegmentInfo is true, a segment prefix and additional linker hints may
106106// / be added to the section name (this is the default).
107107LLVM_ABI std::string getInstrProfSectionName (InstrProfSectKind IPSK,
108- Triple::ObjectFormatType OF,
109- bool AddSegmentInfo = true );
108+ Triple::ObjectFormatType OF,
109+ bool AddSegmentInfo = true );
110110
111111// / Return the name profile runtime entry point to do value profiling
112112// / for a given site.
@@ -222,17 +222,17 @@ LLVM_ABI bool isGPUProfTarget(const Module &M);
222222// / Return the modified name for function \c F suitable to be
223223// / used the key for profile lookup. Variable \c InLTO indicates if this
224224// / is called in LTO optimization passes.
225- LLVM_ABI std::string getPGOFuncName (const Function &F, bool InLTO = false ,
226- uint64_t Version = INSTR_PROF_INDEX_VERSION);
225+ LLVM_ABI std::string
226+ getPGOFuncName (const Function &F, bool InLTO = false ,
227+ uint64_t Version = INSTR_PROF_INDEX_VERSION);
227228
228229// / Return the modified name for a function suitable to be
229230// / used the key for profile lookup. The function's original
230231// / name is \c RawFuncName and has linkage of type \c Linkage.
231232// / The function is defined in module \c FileName.
232- LLVM_ABI std::string getPGOFuncName (StringRef RawFuncName,
233- GlobalValue::LinkageTypes Linkage,
234- StringRef FileName,
235- uint64_t Version = INSTR_PROF_INDEX_VERSION);
233+ LLVM_ABI std::string
234+ getPGOFuncName (StringRef RawFuncName, GlobalValue::LinkageTypes Linkage,
235+ StringRef FileName, uint64_t Version = INSTR_PROF_INDEX_VERSION);
236236
237237// / \return the modified name for function \c F suitable to be
238238// / used as the key for IRPGO profile lookup. \c InLTO indicates if this is
@@ -241,36 +241,38 @@ LLVM_ABI std::string getIRPGOFuncName(const Function &F, bool InLTO = false);
241241
242242// / \return the filename and the function name parsed from the output of
243243// / \c getIRPGOFuncName()
244- LLVM_ABI std::pair<StringRef, StringRef> getParsedIRPGOName (StringRef IRPGOName);
244+ LLVM_ABI std::pair<StringRef, StringRef>
245+ getParsedIRPGOName (StringRef IRPGOName);
245246
246247// / Return the name of the global variable used to store a function
247248// / name in PGO instrumentation. \c FuncName is the IRPGO function name
248249// / (returned by \c getIRPGOFuncName) for LLVM IR instrumentation and PGO
249250// / function name (returned by \c getPGOFuncName) for front-end instrumentation.
250251LLVM_ABI std::string getPGOFuncNameVarName (StringRef FuncName,
251- GlobalValue::LinkageTypes Linkage);
252+ GlobalValue::LinkageTypes Linkage);
252253
253254// / Create and return the global variable for function name used in PGO
254255// / instrumentation. \c FuncName is the IRPGO function name (returned by
255256// / \c getIRPGOFuncName) for LLVM IR instrumentation and PGO function name
256257// / (returned by \c getPGOFuncName) for front-end instrumentation.
257- LLVM_ABI GlobalVariable *createPGOFuncNameVar (Function &F, StringRef PGOFuncName);
258+ LLVM_ABI GlobalVariable *createPGOFuncNameVar (Function &F,
259+ StringRef PGOFuncName);
258260
259261// / Create and return the global variable for function name used in PGO
260262// / instrumentation. \c FuncName is the IRPGO function name (returned by
261263// / \c getIRPGOFuncName) for LLVM IR instrumentation and PGO function name
262264// / (returned by \c getPGOFuncName) for front-end instrumentation.
263265LLVM_ABI GlobalVariable *createPGOFuncNameVar (Module &M,
264- GlobalValue::LinkageTypes Linkage,
265- StringRef PGOFuncName);
266+ GlobalValue::LinkageTypes Linkage,
267+ StringRef PGOFuncName);
266268
267269// / Return the initializer in string of the PGO name var \c NameVar.
268270LLVM_ABI StringRef getPGOFuncNameVarInitializer (GlobalVariable *NameVar);
269271
270272// / Given a PGO function name, remove the filename prefix and return
271273// / the original (static) function name.
272274LLVM_ABI StringRef getFuncNameWithoutPrefix (StringRef PGOFuncName,
273- StringRef FileName = " <unknown>" );
275+ StringRef FileName = " <unknown>" );
274276
275277// / Given a vector of strings (names of global objects like functions or,
276278// / virtual tables) \c NameStrs, the method generates a combined string \c
@@ -282,18 +284,20 @@ LLVM_ABI StringRef getFuncNameWithoutPrefix(StringRef PGOFuncName,
282284// / compressed string. When the string compression is off, the
283285// / second field will have value zero.
284286LLVM_ABI Error collectGlobalObjectNameStrings (ArrayRef<std::string> NameStrs,
285- bool doCompression, std::string &Result);
287+ bool doCompression,
288+ std::string &Result);
286289
287290// / Produce \c Result string with the same format described above. The input
288291// / is vector of PGO function name variables that are referenced.
289292// / The global variable element in 'NameVars' is a string containing the pgo
290293// / name of a function. See `createPGOFuncNameVar` that creates these global
291294// / variables.
292295LLVM_ABI Error collectPGOFuncNameStrings (ArrayRef<GlobalVariable *> NameVars,
293- std::string &Result, bool doCompression = true );
296+ std::string &Result,
297+ bool doCompression = true );
294298
295299LLVM_ABI Error collectVTableStrings (ArrayRef<GlobalVariable *> VTables,
296- std::string &Result, bool doCompression);
300+ std::string &Result, bool doCompression);
297301
298302// / Check if INSTR_PROF_RAW_VERSION_VAR is defined. This global is only being
299303// / set in IR PGO compilation.
@@ -302,7 +306,8 @@ LLVM_ABI bool isIRPGOFlagSet(const Module *M);
302306// / Check if we can safely rename this Comdat function. Instances of the same
303307// / comdat function may have different control flows thus can not share the
304308// / same counter variable.
305- LLVM_ABI bool canRenameComdatFunc (const Function &F, bool CheckAddressTaken = false );
309+ LLVM_ABI bool canRenameComdatFunc (const Function &F,
310+ bool CheckAddressTaken = false );
306311
307312enum InstrProfValueKind : uint32_t {
308313#define VALUE_PROF_KIND (Enumerator, Value, Descr ) Enumerator = Value,
@@ -313,16 +318,17 @@ enum InstrProfValueKind : uint32_t {
313318// / and annotate the instruction \p Inst with the value profile meta data.
314319// / Annotate up to \p MaxMDCount (default 3) number of records per value site.
315320LLVM_ABI void annotateValueSite (Module &M, Instruction &Inst,
316- const InstrProfRecord &InstrProfR,
317- InstrProfValueKind ValueKind, uint32_t SiteIndx,
318- uint32_t MaxMDCount = 3 );
321+ const InstrProfRecord &InstrProfR,
322+ InstrProfValueKind ValueKind, uint32_t SiteIndx,
323+ uint32_t MaxMDCount = 3 );
319324
320325// / Same as the above interface but using an ArrayRef, as well as \p Sum.
321326// / This function will not annotate !prof metadata on the instruction if the
322327// / referenced array is empty.
323328LLVM_ABI void annotateValueSite (Module &M, Instruction &Inst,
324- ArrayRef<InstrProfValueData> VDs, uint64_t Sum,
325- InstrProfValueKind ValueKind, uint32_t MaxMDCount);
329+ ArrayRef<InstrProfValueData> VDs, uint64_t Sum,
330+ InstrProfValueKind ValueKind,
331+ uint32_t MaxMDCount);
326332
327333// TODO: Unify metadata name 'PGOFuncName' and 'PGOName', by supporting read
328334// of this metadata for backward compatibility and generating 'PGOName' only.
@@ -361,8 +367,8 @@ LLVM_ABI bool needsComdatForCounter(const GlobalObject &GV, const Module &M);
361367// / sub-strings. The substrings are separated by `\01` (returned by
362368// / InstrProf.h:getInstrProfNameSeparator). This method decodes the string and
363369// / calls `NameCallback` for each substring.
364- LLVM_ABI Error readAndDecodeStrings (StringRef NameStrings,
365- std::function<Error(StringRef)> NameCallback);
370+ LLVM_ABI Error readAndDecodeStrings (
371+ StringRef NameStrings, std::function<Error(StringRef)> NameCallback);
366372
367373// / An enum describing the attributes of an instrumented profile.
368374enum class InstrProfKind {
@@ -431,9 +437,10 @@ struct TemporalProfTraceTy {
431437 // / Use a set of temporal profile traces to create a list of balanced
432438 // / partitioning function nodes used by BalancedPartitioning to generate a
433439 // / function order that reduces page faults during startup
434- LLVM_ABI static void createBPFunctionNodes (ArrayRef<TemporalProfTraceTy> Traces,
435- std::vector<BPFunctionNode> &Nodes,
436- bool RemoveOutlierUNs = true );
440+ LLVM_ABI static void
441+ createBPFunctionNodes (ArrayRef<TemporalProfTraceTy> Traces,
442+ std::vector<BPFunctionNode> &Nodes,
443+ bool RemoveOutlierUNs = true );
437444};
438445
439446inline std::error_code make_error_code (instrprof_error E) {
@@ -592,7 +599,8 @@ class InstrProfSymtab {
592599
593600 // / Initialize 'this' with the set of vtable names encoded in
594601 // / \c CompressedVTableNames.
595- LLVM_ABI Error initVTableNamesFromCompressedStrings (StringRef CompressedVTableNames);
602+ LLVM_ABI Error
603+ initVTableNamesFromCompressedStrings (StringRef CompressedVTableNames);
596604
597605 // / This interface is used by reader of CoverageMapping test
598606 // / format.
@@ -604,7 +612,8 @@ class InstrProfSymtab {
604612 // / indicates if this is called from LTO optimization passes.
605613 // / A canonical name, removing non-__uniq suffixes, is added if
606614 // / \c AddCanonical is true.
607- LLVM_ABI Error create (Module &M, bool InLTO = false , bool AddCanonical = true );
615+ LLVM_ABI Error create (Module &M, bool InLTO = false ,
616+ bool AddCanonical = true );
608617
609618 // / Create InstrProfSymtab from a set of names iteratable from
610619 // / \p IterRange. This interface is used by IndexedProfReader.
@@ -822,7 +831,7 @@ struct OverlapStats {
822831 }
823832
824833 LLVM_ABI Error accumulateCounts (const std::string &BaseFilename,
825- const std::string &TestFilename, bool IsCS);
834+ const std::string &TestFilename, bool IsCS);
826835 LLVM_ABI void addOneMismatch (const CountSumOrPercent &MismatchFunc);
827836 LLVM_ABI void addOneUnique (const CountSumOrPercent &UniqueFunc);
828837
@@ -862,13 +871,14 @@ struct InstrProfValueSiteRecord {
862871 // / Merge data from another InstrProfValueSiteRecord
863872 // / Optionally scale merged counts by \p Weight.
864873 LLVM_ABI void merge (InstrProfValueSiteRecord &Input, uint64_t Weight,
865- function_ref<void (instrprof_error)> Warn);
874+ function_ref<void (instrprof_error)> Warn);
866875 // / Scale up value profile data counts by N (Numerator) / D (Denominator).
867- LLVM_ABI void scale (uint64_t N, uint64_t D, function_ref<void (instrprof_error)> Warn);
876+ LLVM_ABI void scale (uint64_t N, uint64_t D,
877+ function_ref<void (instrprof_error)> Warn);
868878
869879 // / Compute the overlap b/w this record and Input record.
870880 LLVM_ABI void overlap (InstrProfValueSiteRecord &Input, uint32_t ValueKind,
871- OverlapStats &Overlap, OverlapStats &FuncLevelOverlap);
881+ OverlapStats &Overlap, OverlapStats &FuncLevelOverlap);
872882};
873883
874884// / Profiling information for a single function.
@@ -921,17 +931,18 @@ struct InstrProfRecord {
921931 // / Add ValueData for ValueKind at value Site. We do not support adding sites
922932 // / out of order. Site must go up from 0 one by one.
923933 LLVM_ABI void addValueData (uint32_t ValueKind, uint32_t Site,
924- ArrayRef<InstrProfValueData> VData,
925- InstrProfSymtab *SymTab);
934+ ArrayRef<InstrProfValueData> VData,
935+ InstrProfSymtab *SymTab);
926936
927937 // / Merge the counts in \p Other into this one.
928938 // / Optionally scale merged counts by \p Weight.
929939 LLVM_ABI void merge (InstrProfRecord &Other, uint64_t Weight,
930- function_ref<void (instrprof_error)> Warn);
940+ function_ref<void (instrprof_error)> Warn);
931941
932942 // / Scale up profile counts (including value profile data) by
933943 // / a factor of (N / D).
934- LLVM_ABI void scale (uint64_t N, uint64_t D, function_ref<void (instrprof_error)> Warn);
944+ LLVM_ABI void scale (uint64_t N, uint64_t D,
945+ function_ref<void (instrprof_error)> Warn);
935946
936947 // / Sort value profile data (per site) by count.
937948 void sortValueData () {
@@ -954,12 +965,12 @@ struct InstrProfRecord {
954965
955966 // / Compute the overlap b/w this IntrprofRecord and Other.
956967 LLVM_ABI void overlap (InstrProfRecord &Other, OverlapStats &Overlap,
957- OverlapStats &FuncLevelOverlap, uint64_t ValueCutoff);
968+ OverlapStats &FuncLevelOverlap, uint64_t ValueCutoff);
958969
959970 // / Compute the overlap of value profile counts.
960971 LLVM_ABI void overlapValueProfData (uint32_t ValueKind, InstrProfRecord &Src,
961- OverlapStats &Overlap,
962- OverlapStats &FuncLevelOverlap);
972+ OverlapStats &Overlap,
973+ OverlapStats &FuncLevelOverlap);
963974
964975 enum CountPseudoKind {
965976 NotPseudo = 0 ,
0 commit comments