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:
@ -33,6 +33,9 @@ WAMRCreateMCJITCompilerForModule(LLVMExecutionEngineRef *OutJIT,
|
||||
extern "C" bool
|
||||
aot_check_simd_compatibility(const char *arch_c_str, const char *cpu_c_str);
|
||||
|
||||
extern "C" void
|
||||
aot_func_disable_tce(LLVMValueRef func);
|
||||
|
||||
LLVMBool
|
||||
WAMRCreateMCJITCompilerForModule(LLVMExecutionEngineRef *OutJIT,
|
||||
LLVMModuleRef M,
|
||||
@ -143,3 +146,14 @@ aot_check_simd_compatibility(const char *arch_c_str, const char *cpu_c_str)
|
||||
return true;
|
||||
#endif /* WASM_ENABLE_SIMD */
|
||||
}
|
||||
|
||||
void
|
||||
aot_func_disable_tce(LLVMValueRef func)
|
||||
{
|
||||
Function *F = unwrap<Function>(func);
|
||||
auto Attrs = F->getAttributes();
|
||||
|
||||
Attrs = Attrs.addAttribute(F->getContext(), AttributeList::FunctionIndex,
|
||||
"disable-tail-calls", "true");
|
||||
F->setAttributes(Attrs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user