summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2016-02-22 22:46:21 +0000
committerDehao Chen <dehao@google.com>2016-02-22 22:46:21 +0000
commit6c73b49911e29dc89d40dd95e5548d2359d53414 (patch)
tree1e413ebe4674435571fe8a822b9b0c202b5ba748 /llvm/lib/Transforms
parent3a7def09fece8d6a403f5002dd4811704fa2b3c4 (diff)
downloadbcm5719-llvm-6c73b49911e29dc89d40dd95e5548d2359d53414.tar.gz
bcm5719-llvm-6c73b49911e29dc89d40dd95e5548d2359d53414.zip
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 llvm-svn: 261587
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/SampleProfile.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp
index 9fb6fac9911..b8636665a82 100644
--- a/llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -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);
OpenPOWER on IntegriCloud