summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenPGO.h
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-03-12 20:53:16 +0000
committerJustin Bogner <mail@justinbogner.com>2014-03-12 20:53:16 +0000
commitff9a0582673a6f1e73d5ac60d03e43fb7038ea50 (patch)
tree3d9743bd3c866705dfdbf5b055c5999251841cc9 /clang/lib/CodeGen/CodeGenPGO.h
parentac7c599254731fc878b5f913278dcbaaf092a378 (diff)
downloadbcm5719-llvm-ff9a0582673a6f1e73d5ac60d03e43fb7038ea50.tar.gz
bcm5719-llvm-ff9a0582673a6f1e73d5ac60d03e43fb7038ea50.zip
CodeGen: Use a binary format for instrumentation based profiling
This updates CodeGenPGO to use the ProfileDataReader introduced to llvm in r203703 and the new API for writing out the profile introduced to compiler-rt in r203710. llvm-svn: 203711
Diffstat (limited to 'clang/lib/CodeGen/CodeGenPGO.h')
-rw-r--r--clang/lib/CodeGen/CodeGenPGO.h26
1 files changed, 3 insertions, 23 deletions
diff --git a/clang/lib/CodeGen/CodeGenPGO.h b/clang/lib/CodeGen/CodeGenPGO.h
index 51d59cf9a9b..7c19414a0bd 100644
--- a/clang/lib/CodeGen/CodeGenPGO.h
+++ b/clang/lib/CodeGen/CodeGenPGO.h
@@ -26,27 +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, 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 {
@@ -136,8 +115,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::ProfileDataReader *PGOReader,
+ llvm::Function *Fn);
+ void loadRegionCounts(llvm::ProfileDataReader *PGOReader);
void emitCounterVariables();
/// Emit code to increment the counter at the given index
OpenPOWER on IntegriCloud