mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-08 20:56:13 +00:00
Add our own legacy loop unswitch pass (#1339)
Since legacy binding for loop unswitch pass was removed and we can't get it back. Implement its equivalent in `aot_llvm_extra.cpp` and use it in `aot_compiler.c`. Follow up to #1183.
This commit is contained in:
parent
653b926d53
commit
c075844001
|
@ -2643,9 +2643,8 @@ apply_func_passes(AOTCompContext *comp_ctx)
|
||||||
LLVMAddLoopRotatePass(pass_mgr);
|
LLVMAddLoopRotatePass(pass_mgr);
|
||||||
#if LLVM_VERSION_MAJOR < 15
|
#if LLVM_VERSION_MAJOR < 15
|
||||||
LLVMAddLoopUnswitchPass(pass_mgr);
|
LLVMAddLoopUnswitchPass(pass_mgr);
|
||||||
/* Binding disabled in LLVM 15, don't add the pass util we can either
|
#else
|
||||||
add a binding to SimpleLoopUnswitchPass, or add it to
|
aot_add_simple_loop_unswitch_pass(pass_mgr);
|
||||||
aot_llvm_extra.cpp */
|
|
||||||
#endif
|
#endif
|
||||||
LLVMAddInstructionCombiningPass(pass_mgr);
|
LLVMAddInstructionCombiningPass(pass_mgr);
|
||||||
LLVMAddCFGSimplificationPass(pass_mgr);
|
LLVMAddCFGSimplificationPass(pass_mgr);
|
||||||
|
|
|
@ -499,6 +499,9 @@ aot_check_simd_compatibility(const char *arch_c_str, const char *cpu_c_str);
|
||||||
void
|
void
|
||||||
aot_add_expand_memory_op_pass(LLVMPassManagerRef pass);
|
aot_add_expand_memory_op_pass(LLVMPassManagerRef pass);
|
||||||
|
|
||||||
|
void
|
||||||
|
aot_add_simple_loop_unswitch_pass(LLVMPassManagerRef pass);
|
||||||
|
|
||||||
void
|
void
|
||||||
aot_apply_llvm_new_pass_manager(AOTCompContext *comp_ctx);
|
aot_apply_llvm_new_pass_manager(AOTCompContext *comp_ctx);
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,9 @@ aot_check_simd_compatibility(const char *arch_c_str, const char *cpu_c_str);
|
||||||
void
|
void
|
||||||
aot_add_expand_memory_op_pass(LLVMPassManagerRef pass);
|
aot_add_expand_memory_op_pass(LLVMPassManagerRef pass);
|
||||||
|
|
||||||
|
void
|
||||||
|
aot_add_simple_loop_unswitch_pass(LLVMPassManagerRef pass);
|
||||||
|
|
||||||
void
|
void
|
||||||
aot_func_disable_tce(LLVMValueRef func);
|
aot_func_disable_tce(LLVMValueRef func);
|
||||||
|
|
||||||
|
@ -258,6 +261,12 @@ aot_add_expand_memory_op_pass(LLVMPassManagerRef pass)
|
||||||
unwrap(pass)->add(new ExpandMemoryOpPass());
|
unwrap(pass)->add(new ExpandMemoryOpPass());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
aot_add_simple_loop_unswitch_pass(LLVMPassManagerRef pass)
|
||||||
|
{
|
||||||
|
unwrap(pass)->add(createSimpleLoopUnswitchLegacyPass());
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
aot_check_simd_compatibility(const char *arch_c_str, const char *cpu_c_str)
|
aot_check_simd_compatibility(const char *arch_c_str, const char *cpu_c_str)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user