Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion bolt/lib/Passes/BinaryPasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,11 @@ Error PrintProgramStats::runOnFunctions(BinaryContext &BC) {
if (IsHotParentOfBOLTSplitFunction)
for (const BinaryFunction *Fragment : Function.getFragments())
Size += Fragment->getSize();
double Density = (double)1.0 * Function.getSampleCountInBytes() / Size;
uint64_t ExecutedBytes = Function.getSampleCountInBytes();
if (!ExecutedBytes && Function.hasCFG())
for (const BinaryBasicBlock &BB : Function)
ExecutedBytes += BB.getOriginalSize() * BB.getKnownExecutionCount();
double Density = (double)1.0 * ExecutedBytes / Size;
FuncDensityList.emplace_back(Density, SampleCount);
LLVM_DEBUG(BC.outs() << Function << ": executed bytes "
<< Function.getSampleCountInBytes() << ", size (b) "
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.