Enable LLVM link time optimization (LTO) for AOT (#831)

Enable LLVM link time optimization for AOT and enable it by default,
and provide "wamrc --disable-llvm-lto" option to disable it.
And modify the spec test script, disable it by default when testing
spec cases.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
This commit is contained in:
Wenyong Huang
2021-11-13 16:59:35 +08:00
committed by GitHub
parent 9281286181
commit a1ad950ae1
8 changed files with 72 additions and 2 deletions

View File

@ -17,6 +17,7 @@
#include "llvm-c/Transforms/Utils.h"
#include "llvm-c/Transforms/Scalar.h"
#include "llvm-c/Transforms/Vectorize.h"
#include "llvm-c/Transforms/PassManagerBuilder.h"
#if WASM_ENABLE_LAZY_JIT != 0
#include "aot_llvm_lazyjit.h"
@ -304,9 +305,15 @@ typedef struct AOTCompContext {
/* Disable LLVM built-in intrinsics */
bool disable_llvm_intrinsics;
/* Disable LLVM link time optimization */
bool disable_llvm_lto;
/* Whether optimize the JITed code */
bool optimize;
uint32 opt_level;
uint32 size_level;
/* LLVM pass manager to optimize the JITed code */
LLVMPassManagerRef pass_mgr;
@ -352,6 +359,7 @@ typedef struct AOTCompOption {
bool enable_aux_stack_check;
bool enable_aux_stack_frame;
bool disable_llvm_intrinsics;
bool disable_llvm_lto;
uint32 opt_level;
uint32 size_level;
uint32 output_format;