20 raw_ostream &Out, std::optional<unsigned> VersionOverride)
30 llvm::arrayRefFromStringRef(
Name));
33 auto DescribeRecord = [&](
unsigned RecordID,
StringRef Name) {
35 Data.push_back(RecordID);
53void PGOCtxProfileWriter::writeCounters(
const ContextNode &Node) {
57 for (
uint32_t I = 0U;
I < Node.counters_size(); ++
I)
65void PGOCtxProfileWriter::writeImpl(std::optional<uint32_t> CallerIndex,
75 for (
const auto *Subcontext =
Node.subContexts()[
I]; Subcontext;
76 Subcontext = Subcontext->next())
77 writeImpl(
I, *Subcontext);
82 writeImpl(std::nullopt, RootNode);
void EmitRecord(unsigned Code, const Container &Vals, unsigned Abbrev=0)
EmitRecord - Emit the specified record to the stream, using an abbrev if we have one to compress the ...
void EmitCode(unsigned Val)
EmitCode - Emit the specified code.
void EmitVBR64(uint64_t Val, unsigned NumBits)
void EnterBlockInfoBlock()
EnterBlockInfoBlock - Start emitting the BLOCKINFO_BLOCK.
void EmitVBR(uint32_t Val, unsigned NumBits)
void EnterSubblock(unsigned BlockID, unsigned CodeLen)
static constexpr unsigned VBREncodingBits
static constexpr uint32_t CurrentVersion
static constexpr StringRef ContainerMagic
PGOCtxProfileWriter(raw_ostream &Out, std::optional< unsigned > VersionOverride=std::nullopt)
void write(const ctx_profile::ContextNode &)
static constexpr unsigned CodeLen
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
constexpr size_t size() const
size - Get the string size.
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
This class implements an extremely fast bulk output stream that can only output to a stream.
raw_ostream & write(unsigned char C)
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ BLOCKINFO_CODE_BLOCKNAME
@ BLOCKINFO_CODE_SETRECORDNAME
This is an optimization pass for GlobalISel generic memory operations.
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.