mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
[llvm-profgen][NFC] Fix the incorrect computation of callsite sample count
Differential Revision: https://reviews.llvm.org/D95009
This commit is contained in:
parent
72fa6b23a9
commit
0c9d9969b5
@ -7,7 +7,7 @@
|
||||
; CHECK: 2: 2
|
||||
; CHECK: 4: 1
|
||||
; CHECK: 5: 3
|
||||
; CHECK:[main:1 @ foo]:9:0
|
||||
; CHECK:[main:1 @ foo]:6:0
|
||||
; CHECK: 2: 3
|
||||
; CHECK: 3: 3 bar:3
|
||||
|
||||
|
@ -239,11 +239,9 @@ void CSProfileGenerator::populateFunctionBoundarySamples(
|
||||
|
||||
// Record called target sample and its count
|
||||
const FrameLocation &LeafLoc = Binary->getInlineLeafFrameLoc(SourceOffset);
|
||||
|
||||
FunctionProfile.addCalledTargetSamples(LeafLoc.second.LineOffset,
|
||||
LeafLoc.second.Discriminator,
|
||||
CalleeName, Count);
|
||||
FunctionProfile.addTotalSamples(Count);
|
||||
|
||||
// Record head sample for called target(callee)
|
||||
// TODO: Cleanup ' @ '
|
||||
@ -311,8 +309,10 @@ void CSProfileGenerator::populateInferredFunctionSamples() {
|
||||
CallerLeafFrameLoc.second.LineOffset,
|
||||
CallerLeafFrameLoc.second.Discriminator, CalleeProfile.getName(),
|
||||
EstimatedCallCount);
|
||||
updateBodySamplesforFunctionProfile(CallerProfile, CallerLeafFrameLoc,
|
||||
CallerProfile.addBodySamples(CallerLeafFrameLoc.second.LineOffset,
|
||||
CallerLeafFrameLoc.second.Discriminator,
|
||||
EstimatedCallCount);
|
||||
CallerProfile.addTotalSamples(EstimatedCallCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user