diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2023-02-11 12:38:04 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-02-11 12:38:11 +0000 |
commit | e3b557809604d036af6e00c60f012c2025b59a5e (patch) | |
tree | 8a11ba2269a3b669601e2fd41145b174008f4da8 /llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp | |
parent | 08e8dd7b9db7bb4a9de26d44c1cbfd24e869c014 (diff) |
Diffstat (limited to 'llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp')
-rw-r--r-- | llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp index ec8d318b675b..0945c5688f1f 100644 --- a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp +++ b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp @@ -13,7 +13,6 @@ #include "llvm/Analysis/BlockFrequencyInfoImpl.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/None.h" #include "llvm/ADT/SCCIterator.h" #include "llvm/Config/llvm-config.h" #include "llvm/IR/Function.h" @@ -31,6 +30,7 @@ #include <iterator> #include <list> #include <numeric> +#include <optional> #include <utility> #include <vector> @@ -585,7 +585,7 @@ BlockFrequencyInfoImplBase::getBlockFreq(const BlockNode &Node) const { return Freqs[Node.Index].Integer; } -Optional<uint64_t> +std::optional<uint64_t> BlockFrequencyInfoImplBase::getBlockProfileCount(const Function &F, const BlockNode &Node, bool AllowSynthetic) const { @@ -593,13 +593,13 @@ BlockFrequencyInfoImplBase::getBlockProfileCount(const Function &F, AllowSynthetic); } -Optional<uint64_t> +std::optional<uint64_t> BlockFrequencyInfoImplBase::getProfileCountFromFreq(const Function &F, uint64_t Freq, bool AllowSynthetic) const { auto EntryCount = F.getEntryCount(AllowSynthetic); if (!EntryCount) - return None; + return std::nullopt; // Use 128 bit APInt to do the arithmetic to avoid overflow. APInt BlockCount(128, EntryCount->getCount()); APInt BlockFreq(128, Freq); |