From 5d69f364db02d274408f0d0ae800285449b7c947 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 6 Jun 2023 11:18:16 +0900 Subject: [PATCH] aot/jit: Set module layout (#2260) LLVM 15 and later sometimes perform wrong optimizations without this. --- core/iwasm/compilation/aot_llvm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/iwasm/compilation/aot_llvm.c b/core/iwasm/compilation/aot_llvm.c index c2b3be3a..81b7e8c3 100644 --- a/core/iwasm/compilation/aot_llvm.c +++ b/core/iwasm/compilation/aot_llvm.c @@ -2165,6 +2165,7 @@ aot_create_comp_context(const AOTCompData *comp_data, aot_comp_option_t option) aot_set_last_error("create LLVM target data layout failed."); goto fail; } + LLVMSetModuleDataLayout(comp_ctx->module, target_data_ref); comp_ctx->pointer_size = LLVMPointerSize(target_data_ref); LLVMDisposeTargetData(target_data_ref);