Add "--enable-llvm-passes=<passes>" option to wamrc (#2335)

Add "--enable-llvm-passes=<passes>" option to wamrc for customizing LLVM passes
This commit is contained in:
Huang Qi
2023-07-04 12:20:52 +08:00
committed by GitHub
parent df98d9fb4a
commit 44f4b4f062
5 changed files with 17 additions and 0 deletions

View File

@ -373,6 +373,10 @@ aot_apply_llvm_new_pass_manager(AOTCompContext *comp_ctx, LLVMModuleRef module)
MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
if (comp_ctx->llvm_passes) {
ExitOnErr(PB.parsePassPipeline(MPM, comp_ctx->llvm_passes));
}
if (!disable_llvm_lto) {
/* Apply LTO for AOT mode */
if (comp_ctx->comp_data->func_count >= 10