[llvm] [ORC][JITLink] Add Intel VTune support to JITLink (PR #83957)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 21:09:05 PST 2024


================
@@ -0,0 +1,102 @@
+//===-------------------- VTuneSharedStructs.h ------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Structs and serialization to share VTune-related information
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_VTUNESHAREDSTRUCTS_H
+#define LLVM_EXECUTIONENGINE_ORC_SHARED_VTUNESHAREDSTRUCTS_H
+
+namespace llvm {
+namespace orc {
+
+typedef std::vector<std::pair<unsigned, unsigned>> VTuneLineTable;
+
+// SI = String Index, 1-indexed into the VTuneMethodBatch::Strings table.
+// SI == 0 means replace with nullptr.
+
+// MI = Method Index, 1-indexed into the VTuneMethodBatch::Methods table.
+// MI == 0 means this is a parent method and was not inlined.
+
+struct VTuneMethodInfo {
+  VTuneLineTable LineTable;
+  ExecutorAddr LoadAddr;
+  uint64_t LoadSize;
+  uint64_t MethodID;
+  uint32_t NameSI;
+  uint32_t ClassFileSI;
+  uint32_t SourceFileSI;
+  uint32_t ParentMI;
+};
+
+typedef std::vector<VTuneMethodInfo> VTuneMethodTable;
+typedef std::vector<std::string> VTuneStringTable;
+
+struct VTuneMethodBatch {
+  VTuneMethodTable Methods;
+  VTuneStringTable Strings;
+};
+
+typedef std::vector<std::pair<uint64_t, uint64_t>> VTuneUnloadedMethodIDs;
----------------
MaskRay wrote:

nit: prefer `using`

https://github.com/llvm/llvm-project/pull/83957


More information about the llvm-commits mailing list