[ExecutionEngine] Move IntelJITEventsWrapper to its own library. NFC (#81825)

Split IntelJITEventsWrapper away from IntelJITEvents and rename it into
IntelJITProfiling.
NFC
This commit is contained in:
Hongyu Chen
2024-03-04 08:44:36 -08:00
committed by GitHub
parent c240aca7a8
commit de92615d68
10 changed files with 56 additions and 47 deletions

View File

@@ -28,6 +28,11 @@ if(BUILD_SHARED_LIBS)
target_link_libraries(LLVMExecutionEngine PUBLIC LLVMRuntimeDyld)
endif()
if( LLVM_USE_INTEL_JITEVENTS )
add_subdirectory(IntelJITProfiling)
add_subdirectory(IntelJITEvents)
endif( LLVM_USE_INTEL_JITEVENTS )
add_subdirectory(Interpreter)
add_subdirectory(JITLink)
add_subdirectory(MCJIT)
@@ -38,10 +43,6 @@ if( LLVM_USE_OPROFILE )
add_subdirectory(OProfileJIT)
endif( LLVM_USE_OPROFILE )
if( LLVM_USE_INTEL_JITEVENTS )
add_subdirectory(IntelJITEvents)
endif( LLVM_USE_INTEL_JITEVENTS )
if( LLVM_USE_PERF )
add_subdirectory(PerfJITEvents)
endif( LLVM_USE_PERF )

View File

@@ -1,48 +1,8 @@
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. )
if(NOT DEFINED ITTAPI_GIT_REPOSITORY)
set(ITTAPI_GIT_REPOSITORY https://github.com/intel/ittapi.git)
endif()
if(NOT DEFINED ITTAPI_GIT_TAG)
set(ITTAPI_GIT_TAG v3.18.12)
endif()
if(NOT DEFINED ITTAPI_SOURCE_DIR)
set(ITTAPI_SOURCE_DIR ${PROJECT_BINARY_DIR})
endif()
if(NOT EXISTS ${ITTAPI_SOURCE_DIR}/ittapi)
execute_process(COMMAND ${GIT_EXECUTABLE} clone ${ITTAPI_GIT_REPOSITORY}
WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}
RESULT_VARIABLE GIT_CLONE_RESULT)
if(NOT GIT_CLONE_RESULT EQUAL "0")
message(FATAL_ERROR "git clone ${ITTAPI_GIT_REPOSITORY} failed with ${GIT_CLONE_RESULT}, please clone ${ITTAPI_GIT_REPOSITORY}")
endif()
endif()
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${ITTAPI_GIT_TAG}
WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}/ittapi
RESULT_VARIABLE GIT_CHECKOUT_RESULT)
if(NOT GIT_CHECKOUT_RESULT EQUAL "0")
message(FATAL_ERROR "git checkout ${ITTAPI_GIT_TAG} failed with ${GIT_CHECKOUT_RESULT}, please checkout ${ITTAPI_GIT_TAG} at ${ITTAPI_SOURCE_DIR}/ittapi")
endif()
include_directories( ${ITTAPI_SOURCE_DIR}/ittapi/include/ )
if( HAVE_LIBDL )
set(LLVM_INTEL_JIT_LIBS ${CMAKE_DL_LIBS})
endif()
set(LLVM_INTEL_JIT_LIBS ${LLVM_PTHREAD_LIB} ${LLVM_INTEL_JIT_LIBS})
include_directories( ${PROJECT_BINARY_DIR}/ittapi/include/ )
add_llvm_component_library(LLVMIntelJITEvents
IntelJITEventListener.cpp
jitprofiling.c
${ITTAPI_SOURCE_DIR}/ittapi/src/ittnotify/ittnotify_static.c
LINK_LIBS ${LLVM_INTEL_JIT_LIBS}
LINK_COMPONENTS
CodeGen
@@ -51,6 +11,7 @@ add_llvm_component_library(LLVMIntelJITEvents
Support
Object
ExecutionEngine
IntelJITProfiling
)
add_dependencies(LLVMIntelJITEvents LLVMCodeGen)

View File

@@ -11,7 +11,7 @@
//
//===----------------------------------------------------------------------===//
#include "IntelJITEventsWrapper.h"
#include "IntelJITProfiling/IntelJITEventsWrapper.h"
#include "ittnotify.h"
#include "llvm-c/ExecutionEngine.h"
#include "llvm/ADT/DenseMap.h"

View File

@@ -0,0 +1,47 @@
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. )
if(NOT DEFINED ITTAPI_GIT_REPOSITORY)
set(ITTAPI_GIT_REPOSITORY https://github.com/intel/ittapi.git)
endif()
if(NOT DEFINED ITTAPI_GIT_TAG)
set(ITTAPI_GIT_TAG v3.18.12)
endif()
if(NOT DEFINED ITTAPI_SOURCE_DIR)
set(ITTAPI_SOURCE_DIR ${PROJECT_BINARY_DIR})
endif()
if(NOT EXISTS ${ITTAPI_SOURCE_DIR}/ittapi)
execute_process(COMMAND ${GIT_EXECUTABLE} clone ${ITTAPI_GIT_REPOSITORY}
WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}
RESULT_VARIABLE GIT_CLONE_RESULT)
if(NOT GIT_CLONE_RESULT EQUAL "0")
message(FATAL_ERROR "git clone ${ITTAPI_GIT_REPOSITORY} failed with ${GIT_CLONE_RESULT}, please clone ${ITTAPI_GIT_REPOSITORY}")
endif()
endif()
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${ITTAPI_GIT_TAG}
WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}/ittapi
RESULT_VARIABLE GIT_CHECKOUT_RESULT)
if(NOT GIT_CHECKOUT_RESULT EQUAL "0")
message(FATAL_ERROR "git checkout ${ITTAPI_GIT_TAG} failed with ${GIT_CHECKOUT_RESULT}, please checkout ${ITTAPI_GIT_TAG} at ${ITTAPI_SOURCE_DIR}/ittapi")
endif()
include_directories( ${ITTAPI_SOURCE_DIR}/ittapi/include/ )
if( HAVE_LIBDL )
set(LLVM_INTEL_JIT_LIBS ${CMAKE_DL_LIBS})
endif()
set(LLVM_INTEL_JIT_LIBS ${LLVM_PTHREAD_LIB} ${LLVM_INTEL_JIT_LIBS})
add_llvm_component_library(LLVMIntelJITProfiling
jitprofiling.c
${ITTAPI_SOURCE_DIR}/ittapi/src/ittnotify/ittnotify_static.c
LINK_LIBS ${LLVM_INTEL_JIT_LIBS}
)

View File

@@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
#include "../../lib/ExecutionEngine/IntelJITEvents/IntelJITEventsWrapper.h"
#include "../../lib/ExecutionEngine/IntelJITProfiling/IntelJITEventsWrapper.h"
#include "llvm/ExecutionEngine/JITEventListener.h"
#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/ExecutionEngine/SectionMemoryManager.h"