LLVM 20.0.0git
VTuneSharedStructs.h
Go to the documentation of this file.
1//===-------------------- VTuneSharedStructs.h ------------------*- 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// Structs and serialization to share VTune-related information
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_VTUNESHAREDSTRUCTS_H
14#define LLVM_EXECUTIONENGINE_ORC_SHARED_VTUNESHAREDSTRUCTS_H
15
16#include "ExecutorAddress.h"
17#include <utility>
18#include <vector>
19
20namespace llvm {
21namespace orc {
22
23using VTuneLineTable = std::vector<std::pair<unsigned, unsigned>>;
24
25// SI = String Index, 1-indexed into the VTuneMethodBatch::Strings table.
26// SI == 0 means replace with nullptr.
27
28// MI = Method Index, 1-indexed into the VTuneMethodBatch::Methods table.
29// MI == 0 means this is a parent method and was not inlined.
30
40};
41
42using VTuneMethodTable = std::vector<VTuneMethodInfo>;
43using VTuneStringTable = std::vector<std::string>;
44
48};
49
51
52namespace shared {
53
62
64public:
65 static size_t size(const VTuneMethodInfo &MI) {
66 return SPSVTuneMethodInfo::AsArgList::size(
67 MI.LineTable, MI.LoadAddr, MI.LoadSize, MI.MethodID, MI.NameSI,
68 MI.ClassFileSI, MI.SourceFileSI, MI.ParentMI);
69 }
70
72 return SPSVTuneMethodInfo::AsArgList::deserialize(
73 IB, MI.LineTable, MI.LoadAddr, MI.LoadSize, MI.MethodID, MI.NameSI,
74 MI.ClassFileSI, MI.SourceFileSI, MI.ParentMI);
75 }
76
77 static bool serialize(SPSOutputBuffer &OB, const VTuneMethodInfo &MI) {
78 return SPSVTuneMethodInfo::AsArgList::serialize(
79 OB, MI.LineTable, MI.LoadAddr, MI.LoadSize, MI.MethodID, MI.NameSI,
80 MI.ClassFileSI, MI.SourceFileSI, MI.ParentMI);
81 }
82};
83
84template <>
86public:
87 static size_t size(const VTuneMethodBatch &MB) {
88 return SPSVTuneMethodBatch::AsArgList::size(MB.Methods, MB.Strings);
89 }
90
92 return SPSVTuneMethodBatch::AsArgList::deserialize(IB, MB.Methods,
93 MB.Strings);
94 }
95
96 static bool serialize(SPSOutputBuffer &OB, const VTuneMethodBatch &MB) {
97 return SPSVTuneMethodBatch::AsArgList::serialize(OB, MB.Methods,
98 MB.Strings);
99 }
100};
101
102} // end namespace shared
103} // end namespace orc
104} // end namespace llvm
105
106#endif
IRTranslator LLVM IR MI
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1196
Represents an address in the executor process.
Input char buffer with underflow check.
Output char buffer with overflow check.
static bool serialize(SPSOutputBuffer &OB, const VTuneMethodBatch &MB)
static bool serialize(SPSOutputBuffer &OB, const VTuneMethodInfo &MI)
Specialize to describe how to serialize/deserialize to/from the given concrete type.
SPSSequence< SPSTuple< uint32_t, uint32_t > > SPSVTuneLineTable
std::vector< std::string > VTuneStringTable
std::vector< VTuneMethodInfo > VTuneMethodTable
std::vector< std::pair< unsigned, unsigned > > VTuneLineTable
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18