Skip to content

Commit 2f213ba

Browse files
yamtlum1n0us
authored andcommitted
LLVM: don't verify instcombine fixpoint (bytecodealliance#4219)
LLVM 18 and later, instcombine perfoms only one iteration. it performs extra "verify fixpoint" operation when instcombine is specified in certain ways, including how we do so here. a problem is that the verification raises a fatal error when it finds we didn't reach a fixpoint: LLVM ERROR: Instruction Combining did not reach a fixpoint after 1 iterations while it should be rare, it's quite normal not to reach a fixpoint. this commit fixes the issue by simply disabing the verification. cf. llvm/llvm-project@4189584
1 parent b65ea71 commit 2f213ba

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/iwasm/compilation/aot_llvm_extra.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,15 @@ aot_apply_llvm_new_pass_manager(AOTCompContext *comp_ctx, LLVMModuleRef module)
318318
ModulePassManager MPM;
319319

320320
if (comp_ctx->is_jit_mode) {
321+
#if LLVM_VERSION_MAJOR >= 18
322+
#define INSTCOMBINE "instcombine<no-verify-fixpoint>"
323+
#else
324+
#define INSTCOMBINE "instcombine"
325+
#endif
321326
const char *Passes =
322327
"loop-vectorize,slp-vectorizer,"
323328
"load-store-vectorizer,vector-combine,"
324-
"mem2reg,instcombine,simplifycfg,jump-threading,indvars";
329+
"mem2reg," INSTCOMBINE ",simplifycfg,jump-threading,indvars";
325330
ExitOnErr(PB.parsePassPipeline(MPM, Passes));
326331
}
327332
else {

0 commit comments

Comments
 (0)