From 74391ad33acc209f15f7fae0294ef3c3aeba4ed6 Mon Sep 17 00:00:00 2001 From: Sean Silva Date: Sat, 28 May 2016 04:19:40 +0000 Subject: [PATCH] Inline this into its only use. NFC. The name was out of date at this point and it seems simple enough to have in-line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271093 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Instrumentation/PGOInstrumentation.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/lib/Transforms/Instrumentation/PGOInstrumentation.cpp index ccfdf1a7657..87970e66a97 100644 --- a/lib/Transforms/Instrumentation/PGOInstrumentation.cpp +++ b/lib/Transforms/Instrumentation/PGOInstrumentation.cpp @@ -847,15 +847,6 @@ PreservedAnalyses PGOInstrumentationGen::run(Module &M, return PreservedAnalyses::none(); } -static void setPGOCountOnFunc(PGOUseFunc &Func, - IndexedInstrProfReader *PGOReader) { - if (Func.readCounters(PGOReader)) { - Func.populateCounters(); - Func.setBranchWeights(); - Func.annotateIndirectCallSites(); - } -} - static bool annotateAllFunctions( Module &M, StringRef ProfileFileName, function_ref LookupBPI, @@ -895,7 +886,11 @@ static bool annotateAllFunctions( auto *BPI = LookupBPI(F); auto *BFI = LookupBFI(F); PGOUseFunc Func(F, &M, BPI, BFI); - setPGOCountOnFunc(Func, PGOReader.get()); + if (!Func.readCounters(PGOReader.get())) + continue; + Func.populateCounters(); + Func.setBranchWeights(); + Func.annotateIndirectCallSites(); if (!Func.getProfileRecord().Counts.empty()) Builder.addRecord(Func.getProfileRecord()); PGOUseFunc::FuncFreqAttr FreqAttr = Func.getFuncFreqAttr(); -- 2.11.0