mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-07 03:40:35 +00:00
Hookup ProfileSummary with SampleProfilerLoader
Summary: Set ProfileSummary in SampleProfilerLoader. Reviewers: davidxl, eraman Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D21702 llvm-svn: 273745
This commit is contained in:
parent
26ea3e99a5
commit
7fb830e3d2
@ -1275,6 +1275,7 @@ bool SampleProfileLoader::runOnModule(Module &M) {
|
||||
clearFunctionData();
|
||||
retval |= runOnFunction(F);
|
||||
}
|
||||
M.setProfileSummary(Reader->getSummary().getMD(M.getContext()));
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
4
test/Transforms/SampleProfile/Inputs/summary.prof
Normal file
4
test/Transforms/SampleProfile/Inputs/summary.prof
Normal file
@ -0,0 +1,4 @@
|
||||
bar:100:3
|
||||
1: 100
|
||||
foo:200:1
|
||||
1: 200
|
14
test/Transforms/SampleProfile/summary.ll
Normal file
14
test/Transforms/SampleProfile/summary.ll
Normal file
@ -0,0 +1,14 @@
|
||||
; Test that we annotate entire program's summary to IR.
|
||||
; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/summary.prof -S | FileCheck %s
|
||||
|
||||
define i32 @bar() #0 !dbg !1 {
|
||||
entry:
|
||||
ret i32 1, !dbg !2
|
||||
}
|
||||
|
||||
; CHECK-DAG: {{![0-9]+}} = !{i32 1, !"ProfileSummary", {{![0-9]+}}}
|
||||
; CHECK-DAG: {{![0-9]+}} = !{!"NumFunctions", i64 2}
|
||||
; CHECK-DAG: {{![0-9]+}} = !{!"MaxFunctionCount", i64 3}
|
||||
|
||||
!1 = distinct !DISubprogram(name: "bar")
|
||||
!2 = !DILocation(line: 2, scope: !2)
|
Loading…
Reference in New Issue
Block a user