summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/CodeGenPGO.h
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-04-18 21:52:00 +0000
committerJustin Bogner <mail@justinbogner.com>2014-04-18 21:52:00 +0000
commit2a840244b1b655e5863a05bd2e860c31853eacd2 (patch)
tree63375e185c75213da2716062ea45cd192d6c4239 /lib/CodeGen/CodeGenPGO.h
parentc214a6c21ea6fb4367e54391fafc44911680d9e5 (diff)
CodeGen: Use LLVM's InstrProfReader in -fprofile-instr-use=
Update clang to use the InstrProfReader from LLVM to read instrumentation based profile data. This also switches us from the naive text format to the binary format, since that's what's implemented in the reader. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206658 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenPGO.h')
-rw-r--r--lib/CodeGen/CodeGenPGO.h27
1 files changed, 3 insertions, 24 deletions
diff --git a/lib/CodeGen/CodeGenPGO.h b/lib/CodeGen/CodeGenPGO.h
index c59a58e3f8..98e5b1fd1a 100644
--- a/lib/CodeGen/CodeGenPGO.h
+++ b/lib/CodeGen/CodeGenPGO.h
@@ -26,28 +26,6 @@ namespace clang {
namespace CodeGen {
class RegionCounter;
-/// The raw counter data from an instrumented PGO binary
-class PGOProfileData {
-private:
- /// The PGO data
- std::unique_ptr<llvm::MemoryBuffer> DataBuffer;
- /// Offsets into DataBuffer for each function's counters
- llvm::StringMap<unsigned> DataOffsets;
- /// Execution counts for each function.
- llvm::StringMap<uint64_t> FunctionCounts;
- /// The maximal execution count among all functions.
- uint64_t MaxFunctionCount;
- CodeGenModule &CGM;
-public:
- PGOProfileData(CodeGenModule &CGM, std::string Path);
- /// Fill Counts with the profile data for the given function name. Returns
- /// false on success.
- bool getFunctionCounts(StringRef FuncName, uint64_t &FuncHash,
- std::vector<uint64_t> &Counts);
- /// Return the maximum of all known function counts.
- uint64_t getMaximumFunctionCount() { return MaxFunctionCount; }
-};
-
/// Per-function PGO state. This class should generally not be used directly,
/// but instead through the CodeGenFunction and RegionCounter types.
class CodeGenPGO {
@@ -138,8 +116,9 @@ private:
void setFuncName(llvm::Function *Fn);
void mapRegionCounters(const Decl *D);
void computeRegionCounts(const Decl *D);
- void applyFunctionAttributes(PGOProfileData *PGOData, llvm::Function *Fn);
- void loadRegionCounts(PGOProfileData *PGOData);
+ void applyFunctionAttributes(llvm::IndexedInstrProfReader *PGOReader,
+ llvm::Function *Fn);
+ void loadRegionCounts(llvm::IndexedInstrProfReader *PGOReader);
void emitCounterVariables();
llvm::GlobalVariable *buildDataVar();