diff options
author | Xinliang David Li <davidxl@google.com> | 2019-04-24 19:51:16 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2019-04-24 19:51:16 +0000 |
commit | 499c80b89015cf0fa744b228518b5f6632e8c989 (patch) | |
tree | d246a3dcdc237c1f2bb26567f1d64627a6f2fa1d /llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp | |
parent | d129ee34a51e44c9d46a1bf646a12dbf9b438996 (diff) | |
download | bcm5719-llvm-499c80b89015cf0fa744b228518b5f6632e8c989.tar.gz bcm5719-llvm-499c80b89015cf0fa744b228518b5f6632e8c989.zip |
Add optional arg to profile count getters to filter
synthetic profile count.
Differential Revision: http://reviews.llvm.org/D61025
llvm-svn: 359131
Diffstat (limited to 'llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp')
-rw-r--r-- | llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp index f0b9ea6f553..0db6dd04a7e 100644 --- a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp +++ b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp @@ -557,14 +557,17 @@ BlockFrequencyInfoImplBase::getBlockFreq(const BlockNode &Node) const { Optional<uint64_t> BlockFrequencyInfoImplBase::getBlockProfileCount(const Function &F, - const BlockNode &Node) const { - return getProfileCountFromFreq(F, getBlockFreq(Node).getFrequency()); + const BlockNode &Node, + bool AllowSynthetic) const { + return getProfileCountFromFreq(F, getBlockFreq(Node).getFrequency(), + AllowSynthetic); } Optional<uint64_t> BlockFrequencyInfoImplBase::getProfileCountFromFreq(const Function &F, - uint64_t Freq) const { - auto EntryCount = F.getEntryCount(); + uint64_t Freq, + bool AllowSynthetic) const { + auto EntryCount = F.getEntryCount(AllowSynthetic); if (!EntryCount) return None; // Use 128 bit APInt to do the arithmetic to avoid overflow. |