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

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 13:06:31 PST 2024


MaskRay wrote:

Congratulations on having your first Pull Request (PR) merged into the LLVM Project!

This change introduced a cyclic dependency, which appears difficult to resolve.
(https://llvm.org/docs/CodingStandards.html#library-layering)

The library dependencies look like: `LLVMOrcDebugging -> LLVMOrcJIT -> LLVMOrcTargetProcess`. LLVMOrcTargetProcess should not include headers belonging to `LLVMOrcDebugging` (`#include "llvm/ExecutionEngine/Orc/Debugging/VTuneSupportPlugin.h"` in llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderVTune.cpp).

This is best demonstrated as a Bazel build failure
(Bazel is an unofficial build system, so contributors are not obliged to make it work, but library layering issues should be fixed. The CMake build system does not track headers.)

```
% cd utils/bazel/llvm-project-overlay
% bazel-6.3.2 build --config=generic_clang @llvm-project//llvm:OrcTargetProcess
INFO: Analyzed target @llvm-project//llvm:OrcTargetProcess (1 packages loaded, 3373 targets configured).
INFO: Found 1 target...
ERROR: /usr/local/google/home/maskray/.cache/bazel/_bazel_maskray/f4f2a5f8f860ef21363a22b3fde46672/external/llvm-project/llvm/BUILD.bazel:2862:11: Compiling llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderVTune.cpp failed: (Exit 1): clang failed: error executing command (from target @llvm-project//llvm:OrcTargetProcess) /usr/lib/llvm-16/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer ... (remaining 99 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
external/llvm-project/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderVTune.cpp:13:10: fatal error: 'llvm/ExecutionEngine/Orc/Debugging/VTuneSupportPlugin.h' file not found
#include "llvm/ExecutionEngine/Orc/Debugging/VTuneSupportPlugin.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```


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


More information about the llvm-commits mailing list