summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/CodeGenPGO.h
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-01-13 21:24:18 +0000
committerJustin Bogner <mail@justinbogner.com>2014-01-13 21:24:18 +0000
commitd1361b32e7934a5cfaffffa2bad75c25bba08e88 (patch)
tree1a17e8346d776363b5673975fe78576b621f0ac9 /lib/CodeGen/CodeGenPGO.h
parentf1c6bf3d4bdcc6f5ff0e4218db985b65aca782d3 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199138 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenPGO.h')
-rw-r--r--lib/CodeGen/CodeGenPGO.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenPGO.h b/lib/CodeGen/CodeGenPGO.h
index 0a0699067b..a459e42d29 100644
--- a/lib/CodeGen/CodeGenPGO.h
+++ b/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);