From a25a036f85a0a45fc07a413b99162b50c55f0de7 Mon Sep 17 00:00:00 2001 From: Zentrik Date: Sat, 28 Sep 2024 14:49:32 +0100 Subject: [PATCH] Add codegen patch as well --- .../2f50b280dc8e995ef67ad31a5f71adc4c270890d | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/julia-patches/2f50b280dc8e995ef67ad31a5f71adc4c270890d b/julia-patches/2f50b280dc8e995ef67ad31a5f71adc4c270890d index 9a01ec4..b3bda58 100644 --- a/julia-patches/2f50b280dc8e995ef67ad31a5f71adc4c270890d +++ b/julia-patches/2f50b280dc8e995ef67ad31a5f71adc4c270890d @@ -1,3 +1,29 @@ +diff --git a/src/codegen.cpp b/src/codegen.cpp +index a452e0fccd..4ca549b474 100644 +--- a/src/codegen.cpp ++++ b/src/codegen.cpp +@@ -2226,7 +2226,7 @@ static GlobalVariable *get_pointer_to_constant(jl_codegen_params_t &emission_con + static AllocaInst *emit_static_alloca(jl_codectx_t &ctx, Type *lty, Align align) + { + ++EmittedAllocas; +- return new AllocaInst(lty, ctx.topalloca->getModule()->getDataLayout().getAllocaAddrSpace(), nullptr, align, "", /*InsertBefore=*/ctx.topalloca); ++ return new AllocaInst(lty, ctx.topalloca->getModule()->getDataLayout().getAllocaAddrSpace(), nullptr, align, "", /*InsertBefore=*/ctx.topalloca->getIterator()); + } + + static AllocaInst *emit_static_alloca(jl_codectx_t &ctx, unsigned nb, Align align) +@@ -9627,10 +9627,10 @@ static jl_llvm_functions_t + // TODO: inference is invalid if this has any effect (which it often does) + LoadInst *world = new LoadInst(ctx.types().T_size, + prepare_global_in(jl_Module, jlgetworld_global), Twine(), +- /*isVolatile*/false, ctx.types().alignof_ptr, /*insertBefore*/&I); ++ /*isVolatile*/false, ctx.types().alignof_ptr, /*insertBefore*/I.getIterator()); + world->setOrdering(AtomicOrdering::Acquire); + StoreInst *store_world = new StoreInst(world, world_age_field, +- /*isVolatile*/false, ctx.types().alignof_ptr, /*insertBefore*/&I); ++ /*isVolatile*/false, ctx.types().alignof_ptr, /*insertBefore*/I.getIterator()); + (void)store_world; + } + } diff --git a/src/llvm-alloc-opt.cpp b/src/llvm-alloc-opt.cpp index 188955fd50..4299f17a72 100644 --- a/src/llvm-alloc-opt.cpp