diff options
author | Teresa Johnson <tejohnson@google.com> | 2017-12-18 20:02:43 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2017-12-18 20:02:43 +0000 |
commit | 915897e21b1286d396748cf6bf47cebdae32f41e (patch) | |
tree | 90b9dafcaead62eb05d5cf7135137c1fc30c7584 /llvm/test/Transforms/SampleProfile | |
parent | ec76d9c47f5c5a2c9052e24f46e14c837c2e0af0 (diff) | |
download | bcm5719-llvm-915897e21b1286d396748cf6bf47cebdae32f41e.tar.gz bcm5719-llvm-915897e21b1286d396748cf6bf47cebdae32f41e.zip |
[PGO] Fix handling of cold entry count for instrumented PGO
Summary:
In r277849, getEntryCount was changed to return None when the entry
count was 0, specifically for SamplePGO where it means no samples were
recorded. However, for instrumentation PGO a 0 entry count should be
returned directly, since it does mean that the function was completely
cold. Otherwise we end up treating these functions conservatively
in isFunctionEntryCold() and isColdBB().
Instead, for SamplePGO use -1 when there are no samples, and change
getEntryCount to return None when the value is -1.
Reviewers: danielcdh, davidxl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D41307
llvm-svn: 321018
Diffstat (limited to 'llvm/test/Transforms/SampleProfile')
-rw-r--r-- | llvm/test/Transforms/SampleProfile/entry_counts.ll | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/Transforms/SampleProfile/entry_counts.ll b/llvm/test/Transforms/SampleProfile/entry_counts.ll index 6137a6908cf..cab7c87e049 100644 --- a/llvm/test/Transforms/SampleProfile/entry_counts.ll +++ b/llvm/test/Transforms/SampleProfile/entry_counts.ll @@ -9,8 +9,8 @@ entry: ret void, !dbg !9 } -; This function does not have profile, check if function_entry_count is 0 -; CHECK: {{.*}} = !{!"function_entry_count", i64 0} +; This function does not have profile, check if function_entry_count is -1 +; CHECK: {{.*}} = !{!"function_entry_count", i64 -1} define void @no_profile() { entry: ret void |