mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-27 13:40:30 +00:00
Set function entry count as 0 if sample profile is not found for the function.
Summary: This change makes the sample profile's behavior consistent with instr profile. Reviewers: davidxl, eraman, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17522 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261587 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b23b0fffbc
commit
be55cfa5fd
@ -1257,6 +1257,7 @@ bool SampleProfileLoader::runOnModule(Module &M) {
|
||||
}
|
||||
|
||||
bool SampleProfileLoader::runOnFunction(Function &F) {
|
||||
F.setEntryCount(0);
|
||||
Samples = Reader->getSamplesFor(F);
|
||||
if (!Samples->empty())
|
||||
return emitAnnotations(F);
|
||||
|
@ -8,6 +8,13 @@ entry:
|
||||
ret void, !dbg !9
|
||||
}
|
||||
|
||||
; This function does not have profile, check if function_entry_count is 0
|
||||
; CHECK: {{.*}} = !{!"function_entry_count", i64 0}
|
||||
define void @no_profile() {
|
||||
entry:
|
||||
ret void
|
||||
}
|
||||
|
||||
!llvm.dbg.cu = !{!0}
|
||||
!llvm.module.flags = !{!6, !7}
|
||||
!llvm.ident = !{!8}
|
||||
|
Loading…
Reference in New Issue
Block a user