LLVM
22.0.0git
include
llvm
ProfileData
MemProfSummaryBuilder.h
Go to the documentation of this file.
1
//===- MemProfSummaryBuilder.h - MemProf summary building -------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file contains MemProf summary builder.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_PROFILEDATA_MEMPROFSUMMARYBUILDER_H
14
#define LLVM_PROFILEDATA_MEMPROFSUMMARYBUILDER_H
15
16
#include "
llvm/ProfileData/MemProf.h
"
17
#include "
llvm/ProfileData/MemProfSummary.h
"
18
#include "
llvm/Support/Compiler.h
"
19
20
namespace
llvm
{
21
namespace
memprof
{
22
23
class
MemProfSummaryBuilder
{
24
private
:
25
// The set of full context IDs that we've recorded so far. This is needed to
26
// dedup the MIBs, which are duplicated between functions containing inline
27
// instances of the same allocations.
28
DenseSet<uint64_t>
Contexts;
29
30
// Helper called by the public raw and indexed profile addRecord interfaces.
31
void
addRecord(
uint64_t
,
const
PortableMemInfoBlock
&);
32
33
uint64_t
MaxColdTotalSize = 0;
34
uint64_t
MaxWarmTotalSize = 0;
35
uint64_t
MaxHotTotalSize = 0;
36
uint64_t
NumContexts = 0;
37
uint64_t
NumColdContexts = 0;
38
uint64_t
NumHotContexts = 0;
39
40
public
:
41
MemProfSummaryBuilder
() =
default
;
42
~MemProfSummaryBuilder
() =
default
;
43
44
LLVM_ABI
void
addRecord(
const
IndexedMemProfRecord
&);
45
LLVM_ABI
void
addRecord(
const
MemProfRecord
&);
46
LLVM_ABI
std::unique_ptr<MemProfSummary>
getSummary
();
47
};
48
49
}
// namespace memprof
50
}
// namespace llvm
51
52
#endif
// LLVM_PROFILEDATA_MEMPROFSUMMARYBUILDER_H
Compiler.h
LLVM_ABI
#define LLVM_ABI
Definition
Compiler.h:213
MemProfSummary.h
MemProf.h
llvm::DenseSet
Implements a dense probed hash-table based set.
Definition
DenseSet.h:279
llvm::memprof::MemProfSummaryBuilder::MemProfSummaryBuilder
MemProfSummaryBuilder()=default
llvm::memprof::MemProfSummaryBuilder::getSummary
LLVM_ABI std::unique_ptr< MemProfSummary > getSummary()
Definition
MemProfSummaryBuilder.cpp:19
llvm::memprof::MemProfSummaryBuilder::~MemProfSummaryBuilder
~MemProfSummaryBuilder()=default
uint64_t
llvm::memprof
Definition
MemoryProfileInfo.h:25
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
Types.h:26
llvm::memprof::IndexedMemProfRecord
Definition
MemProf.h:438
llvm::memprof::MemProfRecord
Definition
MemProf.h:518
llvm::memprof::PortableMemInfoBlock
Definition
MemProf.h:87
Generated on
for LLVM by
1.14.0