14 #ifndef LLVM_TRANSFORMS_INSTRPROFILING_H
15 #define LLVM_TRANSFORMS_INSTRPROFILING_H
30 class TargetLibraryInfo;
49 struct PerFunctionProfileData {
50 uint32_t NumValueSites[IPVK_Last + 1];
54 PerFunctionProfileData() {
55 memset(NumValueSites, 0,
sizeof(
uint32_t) * (IPVK_Last + 1));
58 DenseMap<GlobalVariable *, PerFunctionProfileData> ProfileDataMap;
59 std::vector<GlobalValue *> UsedVars;
60 std::vector<GlobalVariable *> ReferencedNames;
61 GlobalVariable *NamesVar;
65 std::vector<LoadStorePair> PromotionCandidates;
68 int64_t MemOPSizeRangeStart;
70 int64_t MemOPSizeRangeLast;
72 int64_t TotalCountersPromoted = 0;
76 bool lowerIntrinsics(Function *
F);
79 void promoteCounterLoadStores(Function *
F);
82 bool isCounterPromotionEnabled()
const;
85 void computeNumValueSiteCounts(InstrProfValueProfileInst *
Ins);
88 void lowerValueProfileInst(InstrProfValueProfileInst *
Ins);
91 void lowerIncrement(InstrProfIncrementInst *Inc);
94 void lowerCoverageData(GlobalVariable *CoverageNamesVar);
100 GlobalVariable *getOrCreateRegionCounters(InstrProfIncrementInst *Inc);
109 void emitRegistration();
112 void emitRuntimeHook();
119 void emitInitialization();
124 #endif // LLVM_TRANSFORMS_INSTRPROFILING_H
A Module instance is used to store all the information related to an LLVM module. ...
std::pair< Instruction *, Instruction * > LoadStorePair
Instrumentation based profiling lowering pass.
A CRTP mix-in to automatically provide informational APIs needed for passes.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
A set of analyses that are preserved following a run of a transformation pass.
Triple - Helper class for working with autoconf configuration names.
Provides information about what library functions are available for the current target.
Options for the frontend instrumentation based profiling pass.
A container for analyses that lazily runs them and caches their results.
This header defines various interfaces for pass management in LLVM.
InstrProfiling(const InstrProfOptions &Options)