Implement call Fast JIT function from LLVM JIT jitted code (#1714)
Basically implement the Multi-tier JIT engine. And update document and wamr-test-suites script.
This commit is contained in:
@ -16,7 +16,7 @@ function help()
|
||||
echo "-c clean previous test results, not start test"
|
||||
echo "-s {suite_name} test only one suite (spec)"
|
||||
echo "-m set compile target of iwasm(x86_64\x86_32\armv7_vfp\thumbv7_vfp\riscv64_lp64d\riscv64_lp64)"
|
||||
echo "-t set compile type of iwasm(classic-interp\fast-interp\jit\aot\fast-jit)"
|
||||
echo "-t set compile type of iwasm(classic-interp\fast-interp\jit\aot\fast-jit\multi-tier-jit)"
|
||||
echo "-M enable multi module feature"
|
||||
echo "-p enable multi thread feature"
|
||||
echo "-S enable SIMD feature"
|
||||
@ -29,7 +29,7 @@ function help()
|
||||
OPT_PARSED=""
|
||||
WABT_BINARY_RELEASE="NO"
|
||||
#default type
|
||||
TYPE=("classic-interp" "fast-interp" "jit" "aot" "fast-jit")
|
||||
TYPE=("classic-interp" "fast-interp" "jit" "aot" "fast-jit" "multi-tier-jit")
|
||||
#default target
|
||||
TARGET="X86_64"
|
||||
ENABLE_MULTI_MODULE=0
|
||||
@ -80,7 +80,8 @@ do
|
||||
t)
|
||||
echo "set compile type of wamr " ${OPTARG}
|
||||
if [[ ${OPTARG} != "classic-interp" && ${OPTARG} != "fast-interp" \
|
||||
&& ${OPTARG} != "jit" && ${OPTARG} != "aot" && ${OPTARG} != "fast-jit" ]]; then
|
||||
&& ${OPTARG} != "jit" && ${OPTARG} != "aot"
|
||||
&& ${OPTARG} != "fast-jit" && ${OPTARG} != "multi-tier-jit" ]]; then
|
||||
echo "*----- please varify a type of compile when using -t! -----*"
|
||||
help
|
||||
exit 1
|
||||
@ -201,6 +202,12 @@ readonly FAST_JIT_COMPILE_FLAGS="\
|
||||
-DWAMR_BUILD_FAST_JIT=1 \
|
||||
-DWAMR_BUILD_SPEC_TEST=1"
|
||||
|
||||
readonly MULTI_TIER_JIT_COMPILE_FLAGS="\
|
||||
-DWAMR_BUILD_TARGET=${TARGET} \
|
||||
-DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_INTERP=0 \
|
||||
-DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=1 \
|
||||
-DWAMR_BUILD_SPEC_TEST=1"
|
||||
|
||||
readonly COMPILE_FLAGS=(
|
||||
"${CLASSIC_INTERP_COMPILE_FLAGS}"
|
||||
"${FAST_INTERP_COMPILE_FLAGS}"
|
||||
@ -208,6 +215,7 @@ readonly COMPILE_FLAGS=(
|
||||
"${ORC_LAZY_JIT_COMPILE_FLAGS}"
|
||||
"${AOT_COMPILE_FLAGS}"
|
||||
"${FAST_JIT_COMPILE_FLAGS}"
|
||||
"${MULTI_TIER_JIT_COMPILE_FLAGS}"
|
||||
)
|
||||
|
||||
# TODO: with libiwasm.so only
|
||||
@ -397,6 +405,10 @@ function spec_test()
|
||||
echo "fast-jit doesn't support multi-thread feature yet, skip it"
|
||||
return
|
||||
fi
|
||||
if [[ $1 == 'multi-tier-jit' ]]; then
|
||||
echo "multi-tier-jit doesn't support multi-thread feature yet, skip it"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${ENABLE_XIP} == 1 ]]; then
|
||||
@ -641,7 +653,7 @@ function trigger()
|
||||
|
||||
"fast-jit")
|
||||
echo "work in fast-jit mode"
|
||||
# jit
|
||||
# fast-jit
|
||||
BUILD_FLAGS="$FAST_JIT_COMPILE_FLAGS $EXTRA_COMPILE_FLAGS"
|
||||
build_iwasm_with_cfg $BUILD_FLAGS
|
||||
for suite in "${TEST_CASE_ARR[@]}"; do
|
||||
@ -649,6 +661,16 @@ function trigger()
|
||||
done
|
||||
;;
|
||||
|
||||
"multi-tier-jit")
|
||||
echo "work in multi-tier-jit mode"
|
||||
# multi-tier-jit
|
||||
BUILD_FLAGS="$MULTI_TIER_JIT_COMPILE_FLAGS $EXTRA_COMPILE_FLAGS"
|
||||
build_iwasm_with_cfg $BUILD_FLAGS
|
||||
for suite in "${TEST_CASE_ARR[@]}"; do
|
||||
$suite"_test" multi-tier-jit
|
||||
done
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "unexpected mode, do nothing"
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user