LLVM: don't verify instcombine fixpoint (#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. 41895843b5
This commit is contained in:
YAMAMOTO Takashi 2025-04-27 12:30:35 +09:00 committed by GitHub
parent af2a2040db
commit c2d7fa30df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -318,10 +318,15 @@ aot_apply_llvm_new_pass_manager(AOTCompContext *comp_ctx, LLVMModuleRef module)
ModulePassManager MPM;
if (comp_ctx->is_jit_mode) {
#if LLVM_VERSION_MAJOR >= 18
#define INSTCOMBINE "instcombine<no-verify-fixpoint>"
#else
#define INSTCOMBINE "instcombine"
#endif
const char *Passes =
"loop-vectorize,slp-vectorizer,"
"load-store-vectorizer,vector-combine,"
"mem2reg,instcombine,simplifycfg,jump-threading,indvars";
"mem2reg," INSTCOMBINE ",simplifycfg,jump-threading,indvars";
ExitOnErr(PB.parsePassPipeline(MPM, Passes));
}
else {