mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-03-12 00:45:28 +00:00
Add VectorCombine pass for JIT and AOT (#2923)
It improves performance for some cases. And add several vectorize related passes for JIT mode.
This commit is contained in:
parent
1055c9884b
commit
5a75c31c38
|
@ -45,6 +45,7 @@
|
|||
#include <llvm/Transforms/Vectorize/LoopVectorize.h>
|
||||
#include <llvm/Transforms/Vectorize/LoadStoreVectorizer.h>
|
||||
#include <llvm/Transforms/Vectorize/SLPVectorizer.h>
|
||||
#include <llvm/Transforms/Vectorize/VectorCombine.h>
|
||||
#include <llvm/Transforms/Scalar/LoopRotation.h>
|
||||
#include <llvm/Transforms/Scalar/SimpleLoopUnswitch.h>
|
||||
#include <llvm/Transforms/Scalar/LICM.h>
|
||||
|
@ -315,8 +316,11 @@ aot_apply_llvm_new_pass_manager(AOTCompContext *comp_ctx, LLVMModuleRef module)
|
|||
}
|
||||
|
||||
ModulePassManager MPM;
|
||||
|
||||
if (comp_ctx->is_jit_mode) {
|
||||
const char *Passes =
|
||||
"loop-vectorize,slp-vectorizer,"
|
||||
"load-store-vectorizer,vector-combine,"
|
||||
"mem2reg,instcombine,simplifycfg,jump-threading,indvars";
|
||||
ExitOnErr(PB.parsePassPipeline(MPM, Passes));
|
||||
}
|
||||
|
@ -327,6 +331,7 @@ aot_apply_llvm_new_pass_manager(AOTCompContext *comp_ctx, LLVMModuleRef module)
|
|||
FPM.addPass(LoopVectorizePass());
|
||||
FPM.addPass(SLPVectorizerPass());
|
||||
FPM.addPass(LoadStoreVectorizerPass());
|
||||
FPM.addPass(VectorCombinePass());
|
||||
|
||||
if (comp_ctx->enable_llvm_pgo || comp_ctx->use_prof_file) {
|
||||
/* LICM pass: loop invariant code motion, attempting to remove
|
||||
|
|
Loading…
Reference in New Issue
Block a user