diff options
Diffstat (limited to 'include/llvm/Analysis/BlockFrequencyInfoImpl.h')
-rw-r--r-- | include/llvm/Analysis/BlockFrequencyInfoImpl.h | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/include/llvm/Analysis/BlockFrequencyInfoImpl.h b/include/llvm/Analysis/BlockFrequencyInfoImpl.h index 25b2efd33c98..bfe4fb14a2b8 100644 --- a/include/llvm/Analysis/BlockFrequencyInfoImpl.h +++ b/include/llvm/Analysis/BlockFrequencyInfoImpl.h @@ -1,9 +1,8 @@ //==- BlockFrequencyInfoImpl.h - Block Frequency Implementation --*- C++ -*-==// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -160,10 +159,6 @@ inline raw_ostream &operator<<(raw_ostream &OS, BlockMass X) { } // end namespace bfi_detail -template <> struct isPodLike<bfi_detail::BlockMass> { - static const bool value = true; -}; - /// Base class for BlockFrequencyInfoImpl /// /// BlockFrequencyInfoImplBase has supporting data structures and some @@ -187,9 +182,9 @@ public: struct BlockNode { using IndexType = uint32_t; - IndexType Index = std::numeric_limits<uint32_t>::max(); + IndexType Index; - BlockNode() = default; + BlockNode() : Index(std::numeric_limits<uint32_t>::max()) {} BlockNode(IndexType Index) : Index(Index) {} bool operator==(const BlockNode &X) const { return Index == X.Index; } @@ -525,9 +520,11 @@ public: BlockFrequency getBlockFreq(const BlockNode &Node) const; Optional<uint64_t> getBlockProfileCount(const Function &F, - const BlockNode &Node) const; + const BlockNode &Node, + bool AllowSynthetic = false) const; Optional<uint64_t> getProfileCountFromFreq(const Function &F, - uint64_t Freq) const; + uint64_t Freq, + bool AllowSynthetic = false) const; bool isIrrLoopHeader(const BlockNode &Node); void setBlockFreq(const BlockNode &Node, uint64_t Freq); @@ -973,13 +970,17 @@ public: } Optional<uint64_t> getBlockProfileCount(const Function &F, - const BlockT *BB) const { - return BlockFrequencyInfoImplBase::getBlockProfileCount(F, getNode(BB)); + const BlockT *BB, + bool AllowSynthetic = false) const { + return BlockFrequencyInfoImplBase::getBlockProfileCount(F, getNode(BB), + AllowSynthetic); } Optional<uint64_t> getProfileCountFromFreq(const Function &F, - uint64_t Freq) const { - return BlockFrequencyInfoImplBase::getProfileCountFromFreq(F, Freq); + uint64_t Freq, + bool AllowSynthetic = false) const { + return BlockFrequencyInfoImplBase::getProfileCountFromFreq(F, Freq, + AllowSynthetic); } bool isIrrLoopHeader(const BlockT *BB) { |