LLVM
8.0.1
|
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequencies. More...
#include "llvm/Analysis/BlockFrequencyInfo.h"
Public Member Functions | |
BlockFrequencyInfo () | |
BlockFrequencyInfo (const Function &F, const BranchProbabilityInfo &BPI, const LoopInfo &LI) | |
BlockFrequencyInfo (const BlockFrequencyInfo &)=delete | |
BlockFrequencyInfo & | operator= (const BlockFrequencyInfo &)=delete |
BlockFrequencyInfo (BlockFrequencyInfo &&Arg) | |
BlockFrequencyInfo & | operator= (BlockFrequencyInfo &&RHS) |
~BlockFrequencyInfo () | |
bool | invalidate (Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &) |
Handle invalidation explicitly. More... | |
const Function * | getFunction () const |
const BranchProbabilityInfo * | getBPI () const |
void | view (StringRef="BlockFrequencyDAGs") const |
Pop up a ghostview window with the current block frequency propagation rendered using dot. More... | |
BlockFrequency | getBlockFreq (const BasicBlock *BB) const |
getblockFreq - Return block frequency. More... | |
Optional< uint64_t > | getBlockProfileCount (const BasicBlock *BB) const |
Returns the estimated profile count of BB . More... | |
Optional< uint64_t > | getProfileCountFromFreq (uint64_t Freq) const |
Returns the estimated profile count of Freq . More... | |
bool | isIrrLoopHeader (const BasicBlock *BB) |
Returns true if BB is an irreducible loop header block. More... | |
void | setBlockFreq (const BasicBlock *BB, uint64_t Freq) |
void | setBlockFreqAndScale (const BasicBlock *ReferenceBB, uint64_t Freq, SmallPtrSetImpl< BasicBlock *> &BlocksToScale) |
Set the frequency of ReferenceBB to Freq and scale the frequencies of the blocks in BlocksToScale such that their frequencies relative to ReferenceBB remain unchanged. More... | |
void | calculate (const Function &F, const BranchProbabilityInfo &BPI, const LoopInfo &LI) |
calculate - compute block frequency info for the given function. More... | |
raw_ostream & | printBlockFreq (raw_ostream &OS, const BlockFrequency Freq) const |
raw_ostream & | printBlockFreq (raw_ostream &OS, const BasicBlock *BB) const |
uint64_t | getEntryFreq () const |
void | releaseMemory () |
void | print (raw_ostream &OS) const |
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequencies.
Definition at line 38 of file BlockFrequencyInfo.h.
|
default |
BlockFrequencyInfo::BlockFrequencyInfo | ( | const Function & | F, |
const BranchProbabilityInfo & | BPI, | ||
const LoopInfo & | LI | ||
) |
Definition at line 154 of file BlockFrequencyInfo.cpp.
References calculate().
|
delete |
BlockFrequencyInfo::BlockFrequencyInfo | ( | BlockFrequencyInfo && | Arg | ) |
Definition at line 160 of file BlockFrequencyInfo.cpp.
|
default |
Referenced by operator=().
void BlockFrequencyInfo::calculate | ( | const Function & | F, |
const BranchProbabilityInfo & | BPI, | ||
const LoopInfo & | LI | ||
) |
calculate - compute block frequency info for the given function.
Definition at line 184 of file BlockFrequencyInfo.cpp.
References llvm::AMDGPUISD::BFI, llvm::dbgs(), llvm::StringRef::equals(), llvm::Value::getName(), llvm::GVDT_None, print(), PrintBlockFreq, PrintBlockFreqFuncName, view(), ViewBlockFreqFuncName, and ViewBlockFreqPropagationDAG.
Referenced by BlockFrequencyInfo(), and llvm::BlockFrequencyAnalysis::run().
BlockFrequency BlockFrequencyInfo::getBlockFreq | ( | const BasicBlock * | BB | ) | const |
getblockFreq - Return block frequency.
Return 0 if we don't have the information. Please note that initial frequency is equal to ENTRY_FREQ. It means that we should not rely on the value itself, but only on the comparison to the other block frequencies. We do this to avoid using of floating points.
Definition at line 202 of file BlockFrequencyInfo.cpp.
References llvm::AMDGPUISD::BFI.
Referenced by adjustedSumFreq(), llvm::CFGMST< Edge, BBInfo >::buildEdges(), computeFunctionSummary(), llvm::CodeExtractor::extractCodeRegion(), findBBsToSinkInto(), llvm::InlineFunction(), isColdCallSite(), sinkLoopInvariantInstructions(), and updateCallerBFI().
Optional< uint64_t > BlockFrequencyInfo::getBlockProfileCount | ( | const BasicBlock * | BB | ) | const |
Returns the estimated profile count of BB
.
This computes the relative block frequency of BB
and multiplies it by the enclosing function's count (if available) and returns the value.
Definition at line 207 of file BlockFrequencyInfo.cpp.
References llvm::AMDGPUISD::BFI, getFunction(), and llvm::None.
Referenced by llvm::ProfileSummaryInfo::getProfileCount(), hasProfileData(), llvm::OptimizationRemarkEmitter::invalidate(), llvm::ProfileSummaryInfo::isColdBlock(), and llvm::ProfileSummaryInfo::isHotBlock().
const BranchProbabilityInfo * BlockFrequencyInfo::getBPI | ( | ) | const |
Definition at line 263 of file BlockFrequencyInfo.cpp.
References llvm::AMDGPUISD::BFI, and printBlockFreq().
Referenced by llvm::BlockFrequencyInfoWrapperPass::runOnFunction().
uint64_t BlockFrequencyInfo::getEntryFreq | ( | ) | const |
Definition at line 278 of file BlockFrequencyInfo.cpp.
References llvm::AMDGPUISD::BFI.
Referenced by llvm::CFGMST< Edge, BBInfo >::buildEdges(), and computeFunctionSummary().
Definition at line 259 of file BlockFrequencyInfo.cpp.
References llvm::AMDGPUISD::BFI.
Referenced by getBlockProfileCount(), llvm::GraphTraits< BlockFrequencyInfo * >::getEntryNode(), getProfileCountFromFreq(), llvm::GraphTraits< BlockFrequencyInfo * >::nodes_begin(), and llvm::GraphTraits< BlockFrequencyInfo * >::nodes_end().
Optional< uint64_t > BlockFrequencyInfo::getProfileCountFromFreq | ( | uint64_t | Freq | ) | const |
Returns the estimated profile count of Freq
.
This uses the frequency Freq
and multiplies it by the enclosing function's count (if available) and returns the value.
Definition at line 215 of file BlockFrequencyInfo.cpp.
References llvm::AMDGPUISD::BFI, getFunction(), and llvm::None.
Referenced by llvm::CodeExtractor::extractCodeRegion().
bool BlockFrequencyInfo::invalidate | ( | Function & | F, |
const PreservedAnalyses & | PA, | ||
FunctionAnalysisManager::Invalidator & | |||
) |
Handle invalidation explicitly.
Definition at line 175 of file BlockFrequencyInfo.cpp.
References llvm::PreservedAnalyses::getChecker().
bool BlockFrequencyInfo::isIrrLoopHeader | ( | const BasicBlock * | BB | ) |
Returns true if BB
is an irreducible loop header block.
Otherwise false.
Definition at line 221 of file BlockFrequencyInfo.cpp.
References assert(), and llvm::AMDGPUISD::BFI.
|
delete |
BlockFrequencyInfo & BlockFrequencyInfo::operator= | ( | BlockFrequencyInfo && | RHS | ) |
Definition at line 163 of file BlockFrequencyInfo.cpp.
References llvm::AMDGPUISD::BFI, releaseMemory(), and ~BlockFrequencyInfo().
void BlockFrequencyInfo::print | ( | raw_ostream & | OS | ) | const |
Definition at line 284 of file BlockFrequencyInfo.cpp.
References llvm::AMDGPUISD::BFI, INITIALIZE_PASS_BEGIN(), and INITIALIZE_PASS_DEPENDENCY.
Referenced by calculate(), llvm::BlockFrequencyInfoWrapperPass::getBFI(), and llvm::BlockFrequencyPrinterPass::run().
raw_ostream & BlockFrequencyInfo::printBlockFreq | ( | raw_ostream & | OS, |
const BlockFrequency | Freq | ||
) | const |
Definition at line 268 of file BlockFrequencyInfo.cpp.
References llvm::AMDGPUISD::BFI.
Referenced by getBPI().
raw_ostream & BlockFrequencyInfo::printBlockFreq | ( | raw_ostream & | OS, |
const BasicBlock * | BB | ||
) | const |
Definition at line 273 of file BlockFrequencyInfo.cpp.
References llvm::AMDGPUISD::BFI.
void BlockFrequencyInfo::releaseMemory | ( | ) |
Definition at line 282 of file BlockFrequencyInfo.cpp.
References llvm::AMDGPUISD::BFI.
Referenced by llvm::BlockFrequencyInfoWrapperPass::getBFI(), and operator=().
void BlockFrequencyInfo::setBlockFreq | ( | const BasicBlock * | BB, |
uint64_t | Freq | ||
) |
Definition at line 226 of file BlockFrequencyInfo.cpp.
References assert(), and llvm::AMDGPUISD::BFI.
Referenced by llvm::CodeExtractor::extractCodeRegion(), llvm::InlineFunction(), and updateCallerBFI().
void BlockFrequencyInfo::setBlockFreqAndScale | ( | const BasicBlock * | ReferenceBB, |
uint64_t | Freq, | ||
SmallPtrSetImpl< BasicBlock *> & | BlocksToScale | ||
) |
Set the frequency of ReferenceBB
to Freq
and scale the frequencies of the blocks in BlocksToScale
such that their frequencies relative to ReferenceBB
remain unchanged.
Definition at line 231 of file BlockFrequencyInfo.cpp.
References assert(), llvm::AMDGPUISD::BFI, and llvm::APInt::udiv().
Referenced by updateCallerBFI().
void BlockFrequencyInfo::view | ( | StringRef | title = "BlockFrequencyDAGs" | ) | const |
Pop up a ghostview window with the current block frequency propagation rendered using dot.
Definition at line 255 of file BlockFrequencyInfo.cpp.
References ViewGraph().
Referenced by calculate().