Refactor LLVM JIT (#1613)

Refactor LLVM JIT for some purposes:
- To simplify the source code of JIT compilation
- To simplify the JIT modes
- To align with LLVM latest changes
- To prepare for the Multi-tier JIT compilation, refer to #1302

The changes mainly include:
- Remove the MCJIT mode, replace it with ORC JIT eager mode
- Remove the LLVM legacy pass manager (only keep the LLVM new pass manager)
- Change the lazy mode's LLVM module/function binding:
  change each function in an individual LLVM module into all functions in a single LLVM module
- Upgraded ORC JIT to ORCv2 JIT to enable lazy compilation

Refer to #1468
This commit is contained in:
Wenyong Huang
2022-10-18 20:17:34 +08:00
committed by GitHub
parent 84b1a6c10e
commit e87a554616
22 changed files with 1058 additions and 1104 deletions

View File

@ -84,11 +84,9 @@ endif ()
endif ()
if (WAMR_BUILD_JIT EQUAL 1)
add_definitions("-DWASM_ENABLE_JIT=1")
if (NOT WAMR_BUILD_LAZY_JIT EQUAL 0)
# Enable Lazy JIT by default
set (WAMR_BUILD_LAZY_JIT 1)
add_definitions("-DWASM_ENABLE_LAZY_JIT=1")
endif ()
if (NOT DEFINED LLVM_DIR)
set (LLVM_SRC_ROOT "${WAMR_ROOT_DIR}/core/deps/llvm")
@ -148,13 +146,15 @@ else ()
message (" WAMR Fast JIT disabled")
endif ()
if (WAMR_BUILD_JIT EQUAL 1)
add_definitions("-DWASM_ENABLE_JIT=1")
if (WAMR_BUILD_LAZY_JIT EQUAL 1)
message (" WAMR LLVM Orc Lazy JIT enabled")
add_definitions("-DWASM_ENABLE_LAZY_JIT=1")
message (" WAMR LLVM ORC JIT enabled with Lazy Compilation")
else ()
message (" WAMR LLVM MC JIT enabled")
message (" WAMR LLVM ORC JIT enabled with Eager Compilation")
endif ()
else ()
message (" WAMR LLVM JIT disabled")
message (" WAMR LLVM ORC JIT disabled")
endif ()
if (WAMR_BUILD_LIBC_BUILTIN EQUAL 1)
message (" Libc builtin enabled")