diff options
author | Sean Silva <chisophugis@gmail.com> | 2016-05-28 04:19:40 +0000 |
---|---|---|
committer | Sean Silva <chisophugis@gmail.com> | 2016-05-28 04:19:40 +0000 |
commit | 2e8f095b2a8f8aaf05c527563f0b278b589c6857 (patch) | |
tree | 3891a196e61c569da517aa1ce11f25a15e0a5bc6 /llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp | |
parent | 02b9d892c5e5f5617e67067b21ee981222212554 (diff) | |
download | bcm5719-llvm-2e8f095b2a8f8aaf05c527563f0b278b589c6857.tar.gz bcm5719-llvm-2e8f095b2a8f8aaf05c527563f0b278b589c6857.zip |
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.
llvm-svn: 271093
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp index ccfdf1a7657..87970e66a97 100644 --- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp +++ b/llvm/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<BranchProbabilityInfo *(Function &)> 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(); |