diff options
author | Dehao Chen <dehao@google.com> | 2017-03-06 17:49:59 +0000 |
---|---|---|
committer | Dehao Chen <dehao@google.com> | 2017-03-06 17:49:59 +0000 |
commit | c632a393b7ab455c02343ba70678512d74605ce1 (patch) | |
tree | 348ee5b2f18b764b600f9b9abcfd93163d4f3bff /llvm/lib/Transforms/IPO/SampleProfile.cpp | |
parent | cccdd330f2f76b746d5e54a6f23d6e5bd5c03afd (diff) | |
download | bcm5719-llvm-c632a393b7ab455c02343ba70678512d74605ce1.tar.gz bcm5719-llvm-c632a393b7ab455c02343ba70678512d74605ce1.zip |
Remove the sample pgo annotation heuristic that uses call count to annotate basic block count.
Summary: We do not need that special handling because the debug info is more accurate now. Performance testing shows no regression on google internal benchmarks.
Reviewers: davidxl, aprantl
Reviewed By: aprantl
Subscribers: llvm-commits, aprantl
Differential Revision: https://reviews.llvm.org/D30658
llvm-svn: 297038
Diffstat (limited to 'llvm/lib/Transforms/IPO/SampleProfile.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/SampleProfile.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp index a9f5b0333c5..802347e819b 100644 --- a/llvm/lib/Transforms/IPO/SampleProfile.cpp +++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp @@ -469,16 +469,14 @@ ErrorOr<uint64_t> SampleProfileLoader::getInstWeight(const Instruction &Inst) { // If a call/invoke instruction is inlined in profile, but not inlined here, // it means that the inlined callsite has no sample, thus the call // instruction should have 0 count. - bool IsCall = isa<CallInst>(Inst) || isa<InvokeInst>(Inst); - if (IsCall && findCalleeFunctionSamples(Inst)) + if ((isa<CallInst>(Inst) || isa<InvokeInst>(Inst)) && + findCalleeFunctionSamples(Inst)) return 0; const DILocation *DIL = DLoc; uint32_t LineOffset = getOffset(DIL); uint32_t Discriminator = DIL->getBaseDiscriminator(); - ErrorOr<uint64_t> R = IsCall - ? FS->findCallSamplesAt(LineOffset, Discriminator) - : FS->findSamplesAt(LineOffset, Discriminator); + ErrorOr<uint64_t> R = FS->findSamplesAt(LineOffset, Discriminator); if (R) { bool FirstMark = CoverageTracker.markSamplesUsed(FS, LineOffset, Discriminator, R.get()); |