mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-08 20:56:13 +00:00
Use another default pipeline when opt-level is 0 (#2624)
According to the description of `buildPerModuleDefaultPipeline()` and `buildLTOPreLinkDefaultPipeline()`, it is not allowed to call them with `O0` level. Use `buildO0DefaultPipeline` instead when the opt-level is 0.
This commit is contained in:
parent
059fbfc252
commit
e73993709e
|
@ -343,6 +343,10 @@ aot_apply_llvm_new_pass_manager(AOTCompContext *comp_ctx, LLVMModuleRef module)
|
|||
ExitOnErr(PB.parsePassPipeline(MPM, comp_ctx->llvm_passes));
|
||||
}
|
||||
|
||||
if (OptimizationLevel::O0 == OL) {
|
||||
MPM.addPass(PB.buildO0DefaultPipeline(OL));
|
||||
}
|
||||
else {
|
||||
if (!disable_llvm_lto) {
|
||||
/* Apply LTO for AOT mode */
|
||||
if (comp_ctx->comp_data->func_count >= 10
|
||||
|
@ -356,6 +360,7 @@ aot_apply_llvm_new_pass_manager(AOTCompContext *comp_ctx, LLVMModuleRef module)
|
|||
else {
|
||||
MPM.addPass(PB.buildPerModuleDefaultPipeline(OL));
|
||||
}
|
||||
}
|
||||
|
||||
/* Run specific passes for AOT indirect mode in last since general
|
||||
optimization may create some intrinsic function calls like
|
||||
|
|
Loading…
Reference in New Issue
Block a user