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

Hongyu Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 21:58:33 PST 2024


================
@@ -0,0 +1,218 @@
+//===------- JITLoaderVTune.cpp - Register profiler objects -----*- 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
+//
+//===----------------------------------------------------------------------===//
+//
+// Register objects for access by profilers via the VTune JIT interface.
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderVTune.h"
+#include "llvm/ExecutionEngine/Orc/Shared/VTuneSharedStructs.h"
+#include <map>
+
+#if LLVM_USE_INTEL_JITEVENTS
+#include "IntelJITEventsWrapper.h"
+#include "ittnotify.h"
+
+using namespace llvm;
+using namespace llvm::orc;
+
+static std::unique_ptr<IntelJITEventsWrapper> Wrapper;
----------------
yugier wrote:

Hi Fangrui, I fixed it into a context class, but I do not see the reason why we need a context class here because `Wrapper` is only used in `JITLoaderVTune.cpp`. Could you please elaborate more on it? Thank you! 

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


More information about the llvm-commits mailing list