diff options
| author | Justin Bogner <mail@justinbogner.com> | 2014-01-13 21:24:18 +0000 |
|---|---|---|
| committer | Justin Bogner <mail@justinbogner.com> | 2014-01-13 21:24:18 +0000 |
| commit | 06bd6d04e05ee77710707ca777cbf25da4c414f5 (patch) | |
| tree | ec3105be4f5bf3a0cf5082a57c570a8f3dd97893 /clang/lib/CodeGen/CodeGenPGO.h | |
| parent | 4afcd10e085bffac50aa5ef139cb3eb2c1b295dc (diff) | |
| download | bcm5719-llvm-06bd6d04e05ee77710707ca777cbf25da4c414f5.tar.gz bcm5719-llvm-06bd6d04e05ee77710707ca777cbf25da4c414f5.zip | |
CodeGen: Introduce CodeGenPGO::setCurrentRegionUnreachable
There are a number of places where we do PGO.setCurrentRegionCount(0)
directly after an unconditional branch. Give this operation a name so
that it's clearer why we're doing this.
llvm-svn: 199138
Diffstat (limited to 'clang/lib/CodeGen/CodeGenPGO.h')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenPGO.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenPGO.h b/clang/lib/CodeGen/CodeGenPGO.h index 0a0699067b1..a459e42d299 100644 --- a/clang/lib/CodeGen/CodeGenPGO.h +++ b/clang/lib/CodeGen/CodeGenPGO.h @@ -74,6 +74,10 @@ public: /// of changes to the most recent counter from control flow and non-local /// exits. void setCurrentRegionCount(uint64_t Count) { CurrentRegionCount = Count; } + /// Indicate that the current region is never reached, and thus should have a + /// counter value of zero. This is important so that subsequent regions can + /// correctly track their parent counts. + void setCurrentRegionUnreachable() { setCurrentRegionCount(0); } /// Calculate branch weights appropriate for PGO data llvm::MDNode *createBranchWeights(uint64_t TrueCount, uint64_t FalseCount); |

