Add a ProfileCount class to represent entry counts.

Summary:
The class wraps a uint64_t and an enum to represent the type of profile
count (real and synthetic) with some helper methods.

Reviewers: davidxl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D41883

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322771 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Easwaran Raman
2018-01-17 22:24:23 +00:00
parent cedeeaab1e
commit fd335155cc
11 changed files with 114 additions and 44 deletions
+1 -1
View File
@@ -567,7 +567,7 @@ BlockFrequencyInfoImplBase::getProfileCountFromFreq(const Function &F,
if (!EntryCount)
return None;
// Use 128 bit APInt to do the arithmetic to avoid overflow.
APInt BlockCount(128, EntryCount.getValue());
APInt BlockCount(128, EntryCount.getCount());
APInt BlockFreq(128, Freq);
APInt EntryFreq(128, getEntryFreq());
BlockCount *= BlockFreq;