diff options
Diffstat (limited to 'include/llvm/Transforms/InstrProfiling.h')
-rw-r--r-- | include/llvm/Transforms/InstrProfiling.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/llvm/Transforms/InstrProfiling.h b/include/llvm/Transforms/InstrProfiling.h index 65e69761baddd..0fe6ad5eeac7d 100644 --- a/include/llvm/Transforms/InstrProfiling.h +++ b/include/llvm/Transforms/InstrProfiling.h @@ -28,6 +28,7 @@ namespace llvm { class TargetLibraryInfo; +using LoadStorePair = std::pair<Instruction *, Instruction *>; /// Instrumentation based profiling lowering pass. This pass lowers /// the profile instrumented code generated by FE or the IR based @@ -60,11 +61,26 @@ private: GlobalVariable *NamesVar; size_t NamesSize; + // vector of counter load/store pairs to be register promoted. + std::vector<LoadStorePair> PromotionCandidates; + // The start value of precise value profile range for memory intrinsic sizes. int64_t MemOPSizeRangeStart; // The end value of precise value profile range for memory intrinsic sizes. int64_t MemOPSizeRangeLast; + int64_t TotalCountersPromoted = 0; + + /// Lower instrumentation intrinsics in the function. Returns true if there + /// any lowering. + bool lowerIntrinsics(Function *F); + + /// Register-promote counter loads and stores in loops. + void promoteCounterLoadStores(Function *F); + + /// Returns true if profile counter update register promotion is enabled. + bool isCounterPromotionEnabled() const; + /// Count the number of instrumented value sites for the function. void computeNumValueSiteCounts(InstrProfValueProfileInst *Ins); |