LLVM 22.0.0git
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
19
20namespace llvm {
21namespace memprof {
22
24private:
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
40public:
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
#define LLVM_ABI
Definition Compiler.h:213
Implements a dense probed hash-table based set.
Definition DenseSet.h:261
LLVM_ABI std::unique_ptr< MemProfSummary > getSummary()
This is an optimization pass for GlobalISel generic memory operations.