From ab659972fb89a5353ffe80bd5e3d2393a025558f Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 21 Dec 2022 16:17:08 +0100 Subject: [PATCH] Debug: put back the per-instruction barrier. --- src/codegen.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/codegen.cpp b/src/codegen.cpp index 6e93c012045df..c97e959fb5683 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -7806,6 +7806,13 @@ static jl_llvm_functions_t ctx.builder.SetInsertPoint(tryblk); } else { + if (!jl_is_method(ctx.linfo->def.method) && !ctx.is_opaque_closure) { + // TODO: inference is invalid if this has any effect (which it often does) + LoadInst *world = ctx.builder.CreateAlignedLoad(getSizeTy(ctx.builder.getContext()), + prepare_global_in(jl_Module, jlgetworld_global), Align(sizeof(size_t))); + world->setOrdering(AtomicOrdering::Monotonic); + ctx.builder.CreateAlignedStore(world, world_age_field, Align(sizeof(size_t))); + } emit_stmtpos(ctx, stmt, cursor); mallocVisitStmt(debuginfoloc, nullptr); }