summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/CodeGenPGO.h
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-03-18 21:58:06 +0000
committerJustin Bogner <mail@justinbogner.com>2014-03-18 21:58:06 +0000
commit0ec537c758c02f77226f05404dd6f885fe5cc55e (patch)
tree888c2a1ba284d1233bb669064f1cc502652aefbb /lib/CodeGen/CodeGenPGO.h
parent771ed34680836f96111061f631c7c95714ba41dc (diff)
CodeGen: Include a function hash in instrumentation based profiling
The hash itself is still the number of counters, which isn't all that useful, but this separates the API changes from the actual implementation of the hash and will make it easier to transition to the ProfileData library once it's implemented. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204186 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenPGO.h')
-rw-r--r--lib/CodeGen/CodeGenPGO.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/CodeGen/CodeGenPGO.h b/lib/CodeGen/CodeGenPGO.h
index 2f1fe5dba8..e859324ae0 100644
--- a/lib/CodeGen/CodeGenPGO.h
+++ b/lib/CodeGen/CodeGenPGO.h
@@ -42,7 +42,8 @@ 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);
+ 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; }
};
@@ -57,6 +58,7 @@ private:
llvm::GlobalValue::LinkageTypes FuncLinkage;
unsigned NumRegionCounters;
+ uint64_t FunctionHash;
llvm::GlobalVariable *RegionCounters;
llvm::DenseMap<const Stmt*, unsigned> *RegionCounterMap;
llvm::DenseMap<const Stmt*, uint64_t> *StmtCountMap;
@@ -65,9 +67,9 @@ private:
public:
CodeGenPGO(CodeGenModule &CGM)
- : CGM(CGM), PrefixedFuncName(0), NumRegionCounters(0), RegionCounters(0),
- RegionCounterMap(0), StmtCountMap(0), RegionCounts(0),
- CurrentRegionCount(0) {}
+ : CGM(CGM), PrefixedFuncName(0), NumRegionCounters(0), FunctionHash(0),
+ RegionCounters(0), RegionCounterMap(0), StmtCountMap(0),
+ RegionCounts(0), CurrentRegionCount(0) {}
~CodeGenPGO() {
if (PrefixedFuncName) delete PrefixedFuncName;
}