diff options
author | Diego Novillo <dnovillo@google.com> | 2015-11-23 20:12:21 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@google.com> | 2015-11-23 20:12:21 +0000 |
commit | 243ea6a7d6d90eb52d3e30cb4a2b73d3fd428f88 (patch) | |
tree | 62f4e5699b41bc549abb189383e73747b78736ef /llvm/test/Transforms/SampleProfile/inline-coverage.ll | |
parent | 39f4c2ca3bd0d447202d05f2f83834e05193b76a (diff) | |
download | bcm5719-llvm-243ea6a7d6d90eb52d3e30cb4a2b73d3fd428f88.tar.gz bcm5719-llvm-243ea6a7d6d90eb52d3e30cb4a2b73d3fd428f88.zip |
SamplePGO - Add coverage tracking for samples.
The existing coverage tracker counts the number of records that were used
from the input profile. An alternative view of coverage is to check how
many available samples were applied.
This way, if the profile contains several records with few samples, it
doesn't really matter much that they were not applied. The more
interesting records to apply are the ones that contribute many samples.
llvm-svn: 253912
Diffstat (limited to 'llvm/test/Transforms/SampleProfile/inline-coverage.ll')
-rw-r--r-- | llvm/test/Transforms/SampleProfile/inline-coverage.ll | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/test/Transforms/SampleProfile/inline-coverage.ll b/llvm/test/Transforms/SampleProfile/inline-coverage.ll index 0b97b560a4f..7248540b4f7 100644 --- a/llvm/test/Transforms/SampleProfile/inline-coverage.ll +++ b/llvm/test/Transforms/SampleProfile/inline-coverage.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline-coverage.prof -sample-profile-check-coverage=100 -pass-remarks=sample-profile 2>&1 | FileCheck %s +; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline-coverage.prof -sample-profile-check-record-coverage=100 -sample-profile-check-sample-coverage=110 -pass-remarks=sample-profile -o /dev/null 2>&1 | FileCheck %s ; ; Original code: ; @@ -25,6 +25,11 @@ ; There is one sample record with 0 samples at offset 4 in main() that we never ; use: ; CHECK: warning: coverage.cc:7: 4 of 5 available profile records (80%) were applied +; +; Since the unused sample record contributes no samples, sample coverage should +; be 100%. Note that we get this warning because we are requesting an impossible +; 110% coverage check. +; CHECK: warning: coverage.cc:7: 78834 of 78834 available profile samples (100%) were applied define i64 @_Z3fool(i64 %i) !dbg !4 { entry: |