diff --git a/bolt/include/bolt/Passes/BinaryFunctionCallGraph.h b/bolt/include/bolt/Passes/BinaryFunctionCallGraph.h --- a/bolt/include/bolt/Passes/BinaryFunctionCallGraph.h +++ b/bolt/include/bolt/Passes/BinaryFunctionCallGraph.h @@ -56,15 +56,14 @@ /// The arguments control how the graph is constructed. /// Filter is called on each function, any function that it returns true for /// is omitted from the graph. -/// If IncludeColdCalls is true, then calls from cold BBs are considered for the -/// graph, otherwise they are ignored. -/// UseFunctionHotSize controls whether the hot size of a function is used when -/// filling in the Size attribute of new Nodes. -/// UseEdgeCounts is used to control if the Weight attribute on Arcs is computed -/// using the number of calls. +/// If IncludeSplitCalls is true, then calls from cold BBs are considered for +/// the graph, otherwise they are ignored. UseFunctionHotSize controls whether +/// the hot size of a function is used when filling in the Size attribute of new +/// Nodes. UseEdgeCounts is used to control if the Weight attribute on Arcs is +/// computed using the number of calls. BinaryFunctionCallGraph buildCallGraph(BinaryContext &BC, CgFilterFunction Filter = NoFilter, - bool CgFromPerfData = false, bool IncludeColdCalls = true, + bool CgFromPerfData = false, bool IncludeSplitCalls = true, bool UseFunctionHotSize = false, bool UseSplitHotSize = false, bool UseEdgeCounts = false, bool IgnoreRecursiveCalls = false); diff --git a/bolt/lib/Passes/BinaryFunctionCallGraph.cpp b/bolt/lib/Passes/BinaryFunctionCallGraph.cpp --- a/bolt/lib/Passes/BinaryFunctionCallGraph.cpp +++ b/bolt/lib/Passes/BinaryFunctionCallGraph.cpp @@ -80,7 +80,7 @@ BinaryFunctionCallGraph buildCallGraph(BinaryContext &BC, CgFilterFunction Filter, bool CgFromPerfData, - bool IncludeColdCalls, bool UseFunctionHotSize, + bool IncludeSplitCalls, bool UseFunctionHotSize, bool UseSplitHotSize, bool UseEdgeCounts, bool IgnoreRecursiveCalls) { NamedRegionTimer T1("buildcg", "Callgraph construction", "CG breakdown", @@ -216,8 +216,8 @@ } } else { for (BinaryBasicBlock *BB : Function->getLayout().blocks()) { - // Don't count calls from cold blocks unless requested. - if (BB->isCold() && !IncludeColdCalls) + // Don't count calls from split blocks unless requested. + if (BB->isSplit() && !IncludeSplitCalls) continue; // Determine whether the block is included in Function's (hot) size @@ -225,7 +225,7 @@ bool BBIncludedInFunctionSize = false; if (UseFunctionHotSize && Function->isSplit()) { if (UseSplitHotSize) - BBIncludedInFunctionSize = !BB->isCold(); + BBIncludedInFunctionSize = !BB->isSplit(); else BBIncludedInFunctionSize = BB->getKnownExecutionCount() != 0; } else { diff --git a/bolt/lib/Passes/ReorderFunctions.cpp b/bolt/lib/Passes/ReorderFunctions.cpp --- a/bolt/lib/Passes/ReorderFunctions.cpp +++ b/bolt/lib/Passes/ReorderFunctions.cpp @@ -266,20 +266,19 @@ if (opts::ReorderFunctions != RT_NONE && opts::ReorderFunctions != RT_EXEC_COUNT && opts::ReorderFunctions != RT_USER) { - Cg = buildCallGraph(BC, - [](const BinaryFunction &BF) { - if (!BF.hasProfile()) - return true; - if (BF.getState() != BinaryFunction::State::CFG) - return true; - return false; - }, - opts::CgFromPerfData, - false, // IncludeColdCalls - opts::ReorderFunctionsUseHotSize, - opts::CgUseSplitHotSize, - opts::UseEdgeCounts, - opts::CgIgnoreRecursiveCalls); + Cg = buildCallGraph( + BC, + [](const BinaryFunction &BF) { + if (!BF.hasProfile()) + return true; + if (BF.getState() != BinaryFunction::State::CFG) + return true; + return false; + }, + opts::CgFromPerfData, + /*IncludeSplitCalls=*/false, opts::ReorderFunctionsUseHotSize, + opts::CgUseSplitHotSize, opts::UseEdgeCounts, + opts::CgIgnoreRecursiveCalls); Cg.normalizeArcWeights(); }