Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Analysis/BlockFrequencyInfo.cpp
Show First 20 Lines • Show All 178 Lines • ▼ Show 20 Lines | bool BlockFrequencyInfo::invalidate(Function &F, const PreservedAnalyses &PA, | ||||
auto PAC = PA.getChecker<BlockFrequencyAnalysis>(); | auto PAC = PA.getChecker<BlockFrequencyAnalysis>(); | ||||
return !(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Function>>() || | return !(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Function>>() || | ||||
PAC.preservedSet<CFGAnalyses>()); | PAC.preservedSet<CFGAnalyses>()); | ||||
} | } | ||||
void BlockFrequencyInfo::calculate(const Function &F, | void BlockFrequencyInfo::calculate(const Function &F, | ||||
const BranchProbabilityInfo &BPI, | const BranchProbabilityInfo &BPI, | ||||
const LoopInfo &LI) { | const LoopInfo &LI) { | ||||
if (F.empty()) | |||||
return; | |||||
if (!BFI) | if (!BFI) | ||||
BFI.reset(new ImplType); | BFI.reset(new ImplType); | ||||
BFI->calculate(F, BPI, LI); | BFI->calculate(F, BPI, LI); | ||||
if (ViewBlockFreqPropagationDAG != GVDT_None && | if (ViewBlockFreqPropagationDAG != GVDT_None && | ||||
(ViewBlockFreqFuncName.empty() || | (ViewBlockFreqFuncName.empty() || | ||||
F.getName().equals(ViewBlockFreqFuncName))) { | F.getName().equals(ViewBlockFreqFuncName))) { | ||||
view(); | view(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 154 Lines • Show Last 20 Lines |