Refine AOT exception check when function return (#1752)

Refine AOT exception check in the caller when returning from callee function,
remove the exception check instructions when hw bound check is enabled to
improve the performance: create guard page to trigger signal handler when
exception occurs.
This commit is contained in:
Wenyong Huang
2022-11-30 20:18:28 +08:00
committed by GitHub
parent 7cb1ebc771
commit ce3458da99
8 changed files with 163 additions and 50 deletions

View File

@ -344,11 +344,12 @@ aot_apply_llvm_new_pass_manager(AOTCompContext *comp_ctx, LLVMModuleRef module)
if (!disable_llvm_lto) {
/* Apply LTO for AOT mode */
#if LLVM_VERSION_MAJOR < 14
MPM.addPass(PB.buildLTODefaultPipeline(OL, NULL));
#else
MPM.addPass(PB.buildLTOPreLinkDefaultPipeline(OL));
#endif
if (comp_ctx->comp_data->func_count >= 10)
/* Adds the pre-link optimizations if the func count
is large enough */
MPM.addPass(PB.buildLTOPreLinkDefaultPipeline(OL));
else
MPM.addPass(PB.buildLTODefaultPipeline(OL, NULL));
}
else {
MPM.addPass(PB.buildPerModuleDefaultPipeline(OL));