14#ifndef LLVM_OBJECT_BBADDRMAP_H
15#define LLVM_OBJECT_BBADDRMAP_H
61 static_cast<bool>(Val & (1 << 0)),
static_cast<bool>(Val & (1 << 1)),
62 static_cast<bool>(Val & (1 << 2)),
static_cast<bool>(Val & (1 << 3)),
63 static_cast<bool>(Val & (1 << 4)),
static_cast<bool>(Val & (1 << 5)),
64 static_cast<bool>(Val & (1 << 6)),
static_cast<bool>(Val & (1 << 7))};
67 std::error_code(),
"invalid encoding for BBAddrMap::Features: 0x%x",
112 static_cast<bool>(V & (1 << 1)),
113 static_cast<bool>(V & (1 << 2)),
114 static_cast<bool>(V & (1 << 3)),
115 static_cast<bool>(V & (1 << 4))};
116 if (
MD.encode() != V)
118 std::error_code(),
"invalid encoding for BBEntry::Metadata: 0x%x",
163 Other.BBEntries.begin());
175 return BBRanges.front().BaseAddress;
180 size_t NumBBEntries = 0;
182 NumBBEntries += BBR.BBEntries.size();
188 std::optional<size_t>
191 if (
BBRanges[
I].BaseAddress == BaseAddress)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the SmallVector class.
Tagged union holding either a T or a Error.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This is an optimization pass for GlobalISel generic memory operations.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
static Expected< Metadata > decode(uint32_t V)
bool operator==(const Metadata &Other) const
BBEntry(uint32_t ID, uint32_t Offset, uint32_t Size, Metadata MD, SmallVector< uint32_t, 1 > CallsiteEndOffsets, uint64_t Hash)
SmallVector< uint32_t, 1 > CallsiteEndOffsets
bool canFallThrough() const
bool hasIndirectBranch() const
bool operator==(const BBEntry &Other) const
bool operator==(const BBRangeEntry &Other) const
std::vector< BBEntry > BBEntries
bool operator==(const Features &Other) const
bool hasPGOAnalysisBBData() const
static Expected< Features > decode(uint16_t Val)
bool hasPGOAnalysis() const
const std::vector< BBRangeEntry > & getBBRanges() const
std::vector< BBRangeEntry > BBRanges
size_t getNumBBEntries() const
bool operator==(const BBAddrMap &Other) const
const std::vector< BBEntry > & getBBEntries() const
uint64_t getFunctionAddress() const
std::optional< size_t > getBBRangeIndexForBaseAddress(uint64_t BaseAddress) const
Single successor of a given basic block that contains the tag and branch probability associated with ...
uint32_t ID
Unique ID of this successor basic block.
BranchProbability Prob
Branch Probability of the edge to this successor taken from MBPI.
bool operator==(const SuccessorEntry &Other) const
uint64_t PostLinkFreq
Raw edge count from the post link profile (e.g., from bolt or propeller).
Extra basic block data with fields for block frequency and branch probability.
bool operator==(const PGOBBEntry &Other) const
uint64_t PostLinkBlockFreq
Raw block count taken from the post link profile (e.g., from bolt or propeller).
llvm::SmallVector< SuccessorEntry, 2 > Successors
List of successors of the current block.
BlockFrequency BlockFreq
Block frequency taken from MBFI.
A feature extension of BBAddrMap that holds information relevant to PGO.
bool operator==(const PGOAnalysisMap &Other) const
std::vector< PGOBBEntry > BBEntries
BBAddrMap::Features FeatEnable