diff options
author | Justin Bogner <mail@justinbogner.com> | 2015-05-02 05:00:55 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2015-05-02 05:00:55 +0000 |
commit | 65512647cc63942e86681a2291abf58f93d88f4f (patch) | |
tree | c3c4c9d21aad28b7addd6550ad01e1da93dcba52 /clang/lib/CodeGen/CodeGenFunction.h | |
parent | 72d03efa6d9d78236de8c731c868e426f7ee5608 (diff) | |
download | llvm-65512647cc63942e86681a2291abf58f93d88f4f.zip llvm-65512647cc63942e86681a2291abf58f93d88f4f.tar.gz llvm-65512647cc63942e86681a2291abf58f93d88f4f.tar.bz2 |
InstrProf: Cede ownership of createProfileWeights to CGF
The fact that PGO has a say in how these branch weights are determined
isn't interesting to most of CodeGen, so it makes more sense for this
API to be accessible via CodeGenFunction rather than CodeGenPGO.
llvm-svn: 236380
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 7eca347..134e513 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -889,6 +889,12 @@ private: CodeGenPGO PGO; + /// Calculate branch weights appropriate for PGO data + llvm::MDNode *createProfileWeights(uint64_t TrueCount, uint64_t FalseCount); + llvm::MDNode *createProfileWeights(ArrayRef<uint64_t> Weights); + llvm::MDNode *createProfileWeightsForLoop(const Stmt *Cond, + uint64_t LoopCount); + public: /// Increment the profiler's counter for the given statement. void incrementProfileCounter(const Stmt *S) { |