From e3b557809604d036af6e00c60f012c2025b59a5e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 11 Feb 2023 13:38:04 +0100 Subject: Vendor import of llvm-project main llvmorg-16-init-18548-gb0daacf58f41, the last commit before the upstream release/17.x branch was created. --- llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp') 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 #include #include +#include #include #include @@ -585,7 +585,7 @@ BlockFrequencyInfoImplBase::getBlockFreq(const BlockNode &Node) const { return Freqs[Node.Index].Integer; } -Optional +std::optional BlockFrequencyInfoImplBase::getBlockProfileCount(const Function &F, const BlockNode &Node, bool AllowSynthetic) const { @@ -593,13 +593,13 @@ BlockFrequencyInfoImplBase::getBlockProfileCount(const Function &F, AllowSynthetic); } -Optional +std::optional 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); -- cgit v1.2.3