mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-08 20:56:13 +00:00
Fix compile error of wamrc with llvm-13/llvm-14 (#2261)
This commit is contained in:
parent
5fb5119239
commit
8ef09be604
|
@ -348,12 +348,16 @@ aot_apply_llvm_new_pass_manager(AOTCompContext *comp_ctx, LLVMModuleRef module)
|
||||||
FPM.addPass(LoadStoreVectorizerPass());
|
FPM.addPass(LoadStoreVectorizerPass());
|
||||||
|
|
||||||
if (comp_ctx->enable_llvm_pgo || comp_ctx->use_prof_file) {
|
if (comp_ctx->enable_llvm_pgo || comp_ctx->use_prof_file) {
|
||||||
LICMOptions licm_opt;
|
|
||||||
/* LICM pass: loop invariant code motion, attempting to remove
|
/* LICM pass: loop invariant code motion, attempting to remove
|
||||||
as much code from the body of a loop as possible. Experiments
|
as much code from the body of a loop as possible. Experiments
|
||||||
show it is good to enable it when pgo is enabled. */
|
show it is good to enable it when pgo is enabled. */
|
||||||
|
#if LLVM_VERSION_MAJOR >= 15
|
||||||
|
LICMOptions licm_opt;
|
||||||
FPM.addPass(
|
FPM.addPass(
|
||||||
createFunctionToLoopPassAdaptor(LICMPass(licm_opt), true));
|
createFunctionToLoopPassAdaptor(LICMPass(licm_opt), true));
|
||||||
|
#else
|
||||||
|
FPM.addPass(createFunctionToLoopPassAdaptor(LICMPass(), true));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -4,7 +4,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <llvm-c/TargetMachine.h>
|
#include <llvm-c/TargetMachine.h>
|
||||||
|
#if LLVM_VERSION_MAJOR >= 14
|
||||||
#include <llvm/MC/TargetRegistry.h>
|
#include <llvm/MC/TargetRegistry.h>
|
||||||
|
#else
|
||||||
|
#include <llvm/Support/TargetRegistry.h>
|
||||||
|
#endif
|
||||||
#include <llvm/Target/TargetMachine.h>
|
#include <llvm/Target/TargetMachine.h>
|
||||||
|
|
||||||
#include "bh_assert.h"
|
#include "bh_assert.h"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user