diff options
author | Mircea Trofin <mtrofin@google.com> | 2021-11-13 22:03:10 -0800 |
---|---|---|
committer | Mircea Trofin <mtrofin@google.com> | 2021-11-14 19:03:30 -0800 |
commit | a32c2c380863d02eb0fd5e8757a62d96114b9519 (patch) | |
tree | a8efd17605ad68ca7810556740703fb38c29f9c4 /llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp | |
parent | eec9ca622c2df2bcf3ffa7fad5a2381b829758b7 (diff) | |
download | llvm-a32c2c380863d02eb0fd5e8757a62d96114b9519.zip llvm-a32c2c380863d02eb0fd5e8757a62d96114b9519.tar.gz llvm-a32c2c380863d02eb0fd5e8757a62d96114b9519.tar.bz2 |
[NFC] Use Optional<ProfileCount> to model invalid counts
ProfileCount could model invalid values, but a user had no indication
that the getCount method could return bogus data. Optional<ProfileCount>
addresses that, because the user must dereference the optional. In
addition, the patch removes concept duplication.
Differential Revision: https://reviews.llvm.org/D113839
Diffstat (limited to 'llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp')
-rw-r--r-- | llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp index e4e45b3..2a5e1f6 100644 --- a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp +++ b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp @@ -602,7 +602,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.getCount()); + APInt BlockCount(128, EntryCount->getCount()); APInt BlockFreq(128, Freq); APInt EntryFreq(128, getEntryFreq()); BlockCount *= BlockFreq; |