mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 16:19:52 +00:00
Add function entry counts from sample profiles.
This patch uses the new function profile metadata "function_entry_count" to annotate entry counts from sample profiles. In a sampling profile, the total samples collected at the function entry are an approximation for the number of times that function was invoked. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237265 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -580,6 +580,10 @@ void SampleProfileLoader::propagateWeights(Function &F) {
|
||||
bool Changed = true;
|
||||
unsigned i = 0;
|
||||
|
||||
// Add an entry count to the function using the samples gathered
|
||||
// at the function entry.
|
||||
F.setEntryCount(Samples->getHeadSamples());
|
||||
|
||||
// Before propagation starts, build, for each block, a list of
|
||||
// unique predecessors and successors. This is necessary to handle
|
||||
// identical edges in multiway branches. Since we visit all blocks and all
|
||||
|
||||
Reference in New Issue
Block a user