From c632a393b7ab455c02343ba70678512d74605ce1 Mon Sep 17 00:00:00 2001 From: Dehao Chen Date: Mon, 6 Mar 2017 17:49:59 +0000 Subject: 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 --- llvm/lib/Transforms/IPO/SampleProfile.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Transforms/IPO') 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 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(Inst) || isa(Inst); - if (IsCall && findCalleeFunctionSamples(Inst)) + if ((isa(Inst) || isa(Inst)) && + findCalleeFunctionSamples(Inst)) return 0; const DILocation *DIL = DLoc; uint32_t LineOffset = getOffset(DIL); uint32_t Discriminator = DIL->getBaseDiscriminator(); - ErrorOr R = IsCall - ? FS->findCallSamplesAt(LineOffset, Discriminator) - : FS->findSamplesAt(LineOffset, Discriminator); + ErrorOr R = FS->findSamplesAt(LineOffset, Discriminator); if (R) { bool FirstMark = CoverageTracker.markSamplesUsed(FS, LineOffset, Discriminator, R.get()); -- cgit v1.2.3