14 #ifndef LLVM_TRANSFORMS_INSTRPROFILING_H
15 #define LLVM_TRANSFORMS_INSTRPROFILING_H
24 class TargetLibraryInfo;
41 struct PerFunctionProfileData {
42 uint32_t NumValueSites[IPVK_Last + 1];
45 PerFunctionProfileData() : RegionCounters(nullptr), DataVar(nullptr) {
46 memset(NumValueSites, 0,
sizeof(
uint32_t) * (IPVK_Last + 1));
49 DenseMap<GlobalVariable *, PerFunctionProfileData> ProfileDataMap;
50 std::vector<GlobalValue *> UsedVars;
51 std::vector<GlobalVariable *> ReferencedNames;
52 GlobalVariable *NamesVar;
58 StringRef getCountersSection()
const;
61 StringRef getNameSection()
const;
64 StringRef getDataSection()
const;
67 StringRef getCoverageSection()
const;
70 void computeNumValueSiteCounts(InstrProfValueProfileInst *
Ins);
73 void lowerValueProfileInst(InstrProfValueProfileInst *
Ins);
76 void lowerIncrement(InstrProfIncrementInst *Inc);
79 void lowerCoverageData(GlobalVariable *CoverageNamesVar);
85 GlobalVariable *getOrCreateRegionCounters(InstrProfIncrementInst *Inc);
94 void emitRegistration();
97 void emitRuntimeHook();
104 void emitInitialization();
A Module instance is used to store all the information related to an LLVM module. ...
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.
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)