LLVM 22.0.0git
VTuneSupportPlugin.h
Go to the documentation of this file.
1//===--- VTuneSupportPlugin.h -- Support for VTune profiler ---*- 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// Handles support for registering code with VIntel Tune's Amplifier JIT API.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_EXECUTIONENGINE_ORC_DEBUGGING_VTUNESUPPORT_H
14#define LLVM_EXECUTIONENGINE_ORC_DEBUGGING_VTUNESUPPORT_H
15
16#include "llvm/ADT/DenseMap.h"
23
24namespace llvm {
25
26namespace orc {
27
29public:
31 ExecutorAddr UnregisterImplAddr, bool EmitDebugInfo)
32 : EPC(EPC), RegisterVTuneImplAddr(RegisterImplAddr),
33 UnregisterVTuneImplAddr(UnregisterImplAddr),
34 EmitDebugInfo(EmitDebugInfo) {}
35
36 void modifyPassConfig(MaterializationResponsibility &MR,
38 jitlink::PassConfiguration &Config) override;
39
40 Error notifyEmitted(MaterializationResponsibility &MR) override;
41 Error notifyFailed(MaterializationResponsibility &MR) override;
42 Error notifyRemovingResources(JITDylib &JD, ResourceKey K) override;
43 void notifyTransferringResources(JITDylib &JD, ResourceKey DstKey,
44 ResourceKey SrcKey) override;
45
47 Create(ExecutorProcessControl &EPC, JITDylib &JD, bool EmitDebugInfo,
48 bool TestMode = false);
49
50private:
52 ExecutorAddr RegisterVTuneImplAddr;
53 ExecutorAddr UnregisterVTuneImplAddr;
54 std::mutex PluginMutex;
55 uint64_t NextMethodID = 0;
57 PendingMethodIDs;
59 LoadedMethodIDs;
60 bool EmitDebugInfo;
61};
62
63} // end namespace orc
64
65} // end namespace llvm
66
67#endif
#define LLVM_ABI
Definition Compiler.h:213
This file defines the DenseMap class.
#define G(x, y, z)
Definition MD5.cpp:56
This file defines the SmallVector class.
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
Tagged union holding either a T or a Error.
Definition Error.h:485
Represents an address in the executor process.
ExecutorProcessControl supports interaction with a JIT target process.
Represents a JIT'd dynamic library.
Definition Core.h:902
Plugin instances can be added to the ObjectLinkingLayer to receive callbacks when code is loaded or e...
Tracks responsibility for materialization, and mediates interactions between MaterializationUnits and...
Definition Core.h:576
VTuneSupportPlugin(ExecutorProcessControl &EPC, ExecutorAddr RegisterImplAddr, ExecutorAddr UnregisterImplAddr, bool EmitDebugInfo)
uintptr_t ResourceKey
Definition Core.h:75
This is an optimization pass for GlobalISel generic memory operations.