mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-09 13:16:26 +00:00
Move indirect mode optimization to the last of LLVM pipelines (#1627)
The general optimizations may create some intrinsic function calls like llvm.memset, so we move indirect mode optimization after them to remove these function calls at last. Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
parent
ceff11ee7e
commit
4a1e522c53
|
@ -2704,15 +2704,6 @@ aot_compile_wasm(AOTCompContext *comp_ctx)
|
||||||
|
|
||||||
/* Run IR optimization before feeding in ORCJIT and AOT codegen */
|
/* Run IR optimization before feeding in ORCJIT and AOT codegen */
|
||||||
if (comp_ctx->optimize) {
|
if (comp_ctx->optimize) {
|
||||||
/* Run specific passes for AOT indirect mode */
|
|
||||||
if (!comp_ctx->is_jit_mode && comp_ctx->is_indirect_mode) {
|
|
||||||
bh_print_time("Begin to run optimization passes "
|
|
||||||
"for indirect mode");
|
|
||||||
if (!apply_passes_for_indirect_mode(comp_ctx)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Run passes for AOT/JIT mode.
|
/* Run passes for AOT/JIT mode.
|
||||||
TODO: Apply these passes in the do_ir_transform callback of
|
TODO: Apply these passes in the do_ir_transform callback of
|
||||||
TransformLayer when compiling each jit function, so as to
|
TransformLayer when compiling each jit function, so as to
|
||||||
|
@ -2721,6 +2712,17 @@ aot_compile_wasm(AOTCompContext *comp_ctx)
|
||||||
possible core dump. */
|
possible core dump. */
|
||||||
bh_print_time("Begin to run llvm optimization passes");
|
bh_print_time("Begin to run llvm optimization passes");
|
||||||
aot_apply_llvm_new_pass_manager(comp_ctx, comp_ctx->module);
|
aot_apply_llvm_new_pass_manager(comp_ctx, comp_ctx->module);
|
||||||
|
|
||||||
|
/* Run specific passes for AOT indirect mode in last since general
|
||||||
|
optimization may create some intrinsic function calls like
|
||||||
|
llvm.memset, so let's remove these function calls here. */
|
||||||
|
if (!comp_ctx->is_jit_mode && comp_ctx->is_indirect_mode) {
|
||||||
|
bh_print_time("Begin to run optimization passes "
|
||||||
|
"for indirect mode");
|
||||||
|
if (!apply_passes_for_indirect_mode(comp_ctx)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
bh_print_time("Finish llvm optimization passes");
|
bh_print_time("Finish llvm optimization passes");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user