diff options
author | Sean Silva <chisophugis@gmail.com> | 2016-08-01 02:59:26 +0000 |
---|---|---|
committer | Sean Silva <chisophugis@gmail.com> | 2016-08-01 02:59:26 +0000 |
commit | 620892432332fe344a7a5520983b09ecbf2e6fb6 (patch) | |
tree | 18210e3f5f150a733b3fed429c33cff9faeb4448 /llvm/lib/Analysis/BlockFrequencyInfo.cpp | |
parent | 52626f132ce456fb6cafefc44cd7c66c01e0bd70 (diff) | |
download | bcm5719-llvm-620892432332fe344a7a5520983b09ecbf2e6fb6.tar.gz bcm5719-llvm-620892432332fe344a7a5520983b09ecbf2e6fb6.zip |
CodeExtractor : Add ability to preserve profile data.
Added ability to estimate the entry count of the extracted function and
the branch probabilities of the exit branches.
Patch by River Riddle!
Differential Revision: https://reviews.llvm.org/D22744
llvm-svn: 277313
Diffstat (limited to 'llvm/lib/Analysis/BlockFrequencyInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/BlockFrequencyInfo.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/BlockFrequencyInfo.cpp b/llvm/lib/Analysis/BlockFrequencyInfo.cpp index 1dd8f4fdfcf..5f7060aaa61 100644 --- a/llvm/lib/Analysis/BlockFrequencyInfo.cpp +++ b/llvm/lib/Analysis/BlockFrequencyInfo.cpp @@ -162,6 +162,13 @@ BlockFrequencyInfo::getBlockProfileCount(const BasicBlock *BB) const { return BFI->getBlockProfileCount(*getFunction(), BB); } +Optional<uint64_t> +BlockFrequencyInfo::getProfileCountFromFreq(uint64_t Freq) const { + if (!BFI) + return None; + return BFI->getProfileCountFromFreq(*getFunction(), Freq); +} + void BlockFrequencyInfo::setBlockFreq(const BasicBlock *BB, uint64_t Freq) { assert(BFI && "Expected analysis to be available"); BFI->setBlockFreq(BB, Freq); |