From fca83000145703c2b607936c5a0a258e1ce01ea2 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Tue, 16 May 2023 16:40:35 -0400 Subject: [PATCH] Enable OpaquePointers on LLVM 15 --- src/codegen.cpp | 11 ----------- src/jitlayers.cpp | 4 ++++ src/llvm-version.h | 2 +- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/codegen.cpp b/src/codegen.cpp index e37de75b7c5bcc..1480668bfd7fce 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -9362,17 +9362,6 @@ extern "C" void jl_init_llvm(void) if (clopt && clopt->getNumOccurrences() == 0) cl::ProvidePositionalOption(clopt, "4", 1); -#if JL_LLVM_VERSION >= 150000 - clopt = llvmopts.lookup("opaque-pointers"); - if (clopt && clopt->getNumOccurrences() == 0) { -#ifdef JL_LLVM_OPAQUE_POINTERS - cl::ProvidePositionalOption(clopt, "true", 1); -#else - cl::ProvidePositionalOption(clopt, "false", 1); -#endif - } -#endif - jl_ExecutionEngine = new JuliaOJIT(); bool jl_using_gdb_jitevents = false; diff --git a/src/jitlayers.cpp b/src/jitlayers.cpp index e3f30f7d22d583..8013f37424355f 100644 --- a/src/jitlayers.cpp +++ b/src/jitlayers.cpp @@ -1629,6 +1629,10 @@ JuliaOJIT::JuliaOJIT() DLSymOpt(std::make_unique(false)), ContextPool([](){ auto ctx = std::make_unique(); +#ifndef JL_LLVM_OPAQUE_POINTERS + if (ctx.supportsTypedPointers()) + ctx.setOpaquePointers(false); +#endif return orc::ThreadSafeContext(std::move(ctx)); }), #ifdef JL_USE_JITLINK diff --git a/src/llvm-version.h b/src/llvm-version.h index 01638b8d44a6e5..27fdeef8ef8b85 100644 --- a/src/llvm-version.h +++ b/src/llvm-version.h @@ -14,7 +14,7 @@ #error Only LLVM versions >= 14.0.0 are supported by Julia #endif -#if JL_LLVM_VERSION >= 160000 +#if JL_LLVM_VERSION >= 150000 #define JL_LLVM_OPAQUE_POINTERS 1 #endif