summaryrefslogtreecommitdiff
path: root/bolt/include
diff options
context:
space:
mode:
authorspupyrev <spupyrev@fb.com>2023-02-16 10:52:04 -0800
committerspupyrev <spupyrev@fb.com>2023-03-28 11:09:21 -0700
commit92758a99c319450ad4408ce2359e65314c113231 (patch)
tree814c3cb55ae2e8a6d1c56eb7797893cc07f0b906 /bolt/include
parent69bab9d91986c4be15782e7f82df39da11cf697d (diff)
downloadllvm-92758a99c319450ad4408ce2359e65314c113231.tar.gz
[BOLT] computing raw branch count for yaml profiles
`Function.RawBranchCount` is initialized for fdata profile but not for yaml one. The diff adds the computation of the field for yaml profiles Reviewed By: Amir Differential Revision: https://reviews.llvm.org/D144211
Diffstat (limited to 'bolt/include')
-rw-r--r--bolt/include/bolt/Core/BinaryFunction.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/bolt/include/bolt/Core/BinaryFunction.h b/bolt/include/bolt/Core/BinaryFunction.h
index 7a99ce2481a1..a96243c579eb 100644
--- a/bolt/include/bolt/Core/BinaryFunction.h
+++ b/bolt/include/bolt/Core/BinaryFunction.h
@@ -1794,6 +1794,10 @@ public:
/// executions corresponding to this function.
uint64_t getRawBranchCount() const { return RawBranchCount; }
+ /// Set the profile data about the number of branch executions corresponding
+ /// to this function.
+ void setRawBranchCount(uint64_t Count) { RawBranchCount = Count; }
+
/// Return the execution count for functions with known profile.
/// Return 0 if the function has no profile.
uint64_t getKnownExecutionCount() const {