Skip to content

Commit c2137c9

Browse files
xal-0mlechu
authored andcommitted
Local names linking (JuliaLang#60031)
# Overview This PR overhauls the way linking works in Julia, both in the JIT and AOT. The point is to enable us to generate LLVM IR that depends only on the source IR, eliminating both nondeterminism and statefulness. This serves two purposes. First, if the IR is predictable, we can cache compile objects using the bitcode hash as a key, like how the ThinLTO cache works. JuliaLang#58592 was an early experiment along these lines. Second, we can reuse work that was done in a previous session, like pkgimages, but for the JIT. We accomplish this by generating names that are unique only within the current LLVM module, removing most uses of the `globalUniqueGeneratedNames` counter. The replacement for `jl_codegen_params_t`, `jl_codegen_output_t`, represents a Julia "translation unit", and tracks the information we'll need to link the compiled module into the running session. When linking, we manipulate the JITLink [LinkGraph](https://llvm.org/docs/JITLink.html#linkgraph) (after compilation) instead of renaming functions in the LLVM IR (before). ## Example ``` julia> @noinline foo(x) = x + 2.0 baz(x) = foo(foo(x)) code_llvm(baz, (Int64,); dump_module=true, optimize=false) ``` Nightly: ```llvm [...] @"+Core.Float64#774" = private unnamed_addr constant ptr @"+Core.Float64#774.jit" @"+Core.Float64#774.jit" = private alias ptr, inttoptr (i64 4797624416 to ptr) ; Function Signature: baz(Int64) ; @ REPL[1]:2 within `baz` define double @julia_baz_772(i64 signext %"x::Int64") #0 { top: %pgcstack = call ptr @julia.get_pgcstack() %0 = call double @j_foo_775(i64 signext %"x::Int64") %1 = call double @j_foo_776(double %0) ret double %1 } ; Function Attrs: noinline optnone define nonnull ptr @jfptr_baz_773(ptr %"function::Core.Function", ptr noalias nocapture noundef readonly %"args::Any[]", i32 %"nargs::UInt32") JuliaLang#1 { top: %pgcstack = call ptr @julia.get_pgcstack() %0 = getelementptr inbounds i8, ptr %"args::Any[]", i32 0 %1 = load ptr, ptr %0, align 8 %.unbox = load i64, ptr %1, align 8 %2 = call double @julia_baz_772(i64 signext %.unbox) %"+Core.Float64#774" = load ptr, ptr @"+Core.Float64#774", align 8 %Float64 = ptrtoint ptr %"+Core.Float64#774" to i64 %3 = inttoptr i64 %Float64 to ptr %current_task = getelementptr inbounds i8, ptr %pgcstack, i32 -152 %"box::Float64" = call noalias nonnull align 8 dereferenceable(8) ptr @julia.gc_alloc_obj(ptr %current_task, i64 8, ptr %3) JuliaLang#5 store double %2, ptr %"box::Float64", align 8 ret ptr %"box::Float64" } [...] ``` Diff after this PR. Notice how each symbol gets the lowest possible integer suffix that will make it unique to the module, and how the two specializations for `foo` get different names: ```diff @@ -4,18 +4,18 @@ target triple = "arm64-apple-darwin24.6.0" -@"+Core.Float64#774" = external global ptr +@"+Core.Float64#_0" = external global ptr ; Function Signature: baz(Int64) ; @ REPL[1]:2 within `baz` -define double @julia_baz_772(i64 signext %"x::Int64") #0 { +define double @julia_baz_0(i64 signext %"x::Int64") #0 { top: %pgcstack = call ptr @julia.get_pgcstack() - %0 = call double @j_foo_775(i64 signext %"x::Int64") - %1 = call double @j_foo_776(double %0) + %0 = call double @j_foo_0(i64 signext %"x::Int64") + %1 = call double @j_foo_1(double %0) ret double %1 } ; Function Attrs: noinline optnone -define nonnull ptr @jfptr_baz_773(ptr %"function::Core.Function", ptr noalias nocapture noundef readonly %"args::Any[]", i32 %"nargs::UInt32") JuliaLang#1 { +define nonnull ptr @jfptr_baz_0(ptr %"function::Core.Function", ptr noalias nocapture noundef readonly %"args::Any[]", i32 %"nargs::UInt32") JuliaLang#1 { top: %pgcstack = call ptr @julia.get_pgcstack() @@ -23,7 +23,7 @@ %1 = load ptr, ptr %0, align 8 %.unbox = load i64, ptr %1, align 8 - %2 = call double @julia_baz_772(i64 signext %.unbox) - %"+Core.Float64#774" = load ptr, ptr @"+Core.Float64#774", align 8 - %Float64 = ptrtoint ptr %"+Core.Float64#774" to i64 + %2 = call double @julia_baz_0(i64 signext %.unbox) + %"+Core.Float64#_0" = load ptr, ptr @"+Core.Float64#_0", align 8 + %Float64 = ptrtoint ptr %"+Core.Float64#_0" to i64 %3 = inttoptr i64 %Float64 to ptr %current_task = getelementptr inbounds i8, ptr %pgcstack, i32 -152 @@ -39,8 +39,8 @@ ; Function Signature: foo(Int64) -declare double @j_foo_775(i64 signext) JuliaLang#3 +declare double @j_foo_0(i64 signext) JuliaLang#3 ; Function Signature: foo(Float64) -declare double @j_foo_776(double) JuliaLang#4 +declare double @j_foo_1(double) JuliaLang#4 attributes #0 = { "frame-pointer"="all" "julia.fsig"="baz(Int64)" "probe-stack"="inline-asm" } ``` ## List of changes - Many sources of statefulness and nondeterminism in the emitted LLVM IR have been eliminated, namely: - Function symbols defined for CodeInstances - Global symbols referring to data on the Julia heap - Undefined function symbols referring to invoked external CodeInstances - `jl_codeinst_params_t` has become `jl_codegen_output_t`. It now represents one Julia "translation unit". More than one CodeInstance can be emitted to the same `jl_codegen_output_t`, if desired, though in the JIT every CI gets its own right now. One motivation behind this is to allow us to emit code on multiple threads and avoid the bitcode serialize/deserialize step we currently do, if that proves worthwhile. When we are done emitting to a `jl_codegen_output_t`, we call `.finish()`, which discards the intermediate state and returns only the LLVM module and the info needed for linking (`jl_linker_info_t`). - The new `JLMaterializationUnit` wraps emitting Julia LLVM modules and the associated `jl_linker_info_t`. It informs ORC that we can materialize symbols for the CIs defined by that output, and picks globally unique names for them. When it is materialized, it resolves all the call targets and generates trampolines for CodeInstances that are invoked but have the wrong calling convention, or are not yet compiled. - We now postpone linking decisions to after codegen whenever possible. For example, `emit_invoke` no longer tries to find a compiled version of the CodeInstance, and it no longer generates trampolines to adapt calling conventions. `jl_analyze_workqueue`'s job has been absorbed into `JuliaOJIT::linkOutput`. - Some `image_codegen` differences have been removed: - Codegen no longer cares if a compiled CodeInstance came from an image. During ahead-of-time linking, we generate thunk functions that load the address from the fvars table. - In `jl_emit_native_impl`, emit every CodeInstance into one `jl_codegen_output_t`. We now defer the creation of the `llvm::Linker` for llvmcalls, which has construction cost that grows with the size of the destination module, until the very end. - RTDyld is removed completely, since we cannot control linking like we can with JITLink. Since JuliaLang#60105, platforms that previous used the optimized memory manager now use the new one. ### General refactoring - Adapt the `jl_callingconv_t` enum from `staticdata.c` into `jl_invoke_api_t` and use it in more places. There is one enumerator for each special `jl_callptr_t` function that can go in a CodeInstance's `invoke` field, as well as one that indicates an invoke wrapper should be there. There is a convenience function for reading an invoke pointer and getting the API type, and vice versa. - Avoid using magic string values, and try to directly pass pointers to LLVM `Function *` or ORC string pool entries when possible. ## Future work - `DLSymOptimizer` should be mostly removed, in favour of emitting raw ccalls and redirecting them to the appropriate target during linking. - We should support ahead-of-time linking multiple `jl_codegen_output_t`s together, in order to parallelize LLVM IR emission when compiling a system image. - We still pass strings to `emit_call_specfun_other`, even though the prototype for the function is now created by `jl_codegen_output_t::get_call_target`. We should hold on to the calling convention info so it doesn't have to be recomputed.
1 parent 547c6cd commit c2137c9

25 files changed

Lines changed: 2027 additions & 2089 deletions

base/reflection.jl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,19 +183,28 @@ struct CodegenParams
183183
"""
184184
sanitize_address::Cint
185185

186+
"""
187+
When enabled, generate names that are globally unique in this Julia session,
188+
across all code generated with this flag set. Intended for llvmpasses
189+
tests.
190+
"""
191+
unique_names::Cint
192+
186193
function CodegenParams(; track_allocations::Bool=true, code_coverage::Bool=true,
187194
prefer_specsig::Bool=false,
188195
gnu_pubnames::Bool=true, debug_info_kind::Cint = default_debug_info_kind(),
189196
debug_info_level::Cint = Cint(JLOptions().debug_level), safepoint_on_entry::Bool=true,
190197
gcstack_arg::Bool=true, use_jlplt::Bool=true, force_emit_all::Bool=false,
191-
sanitize_memory::Bool=false, sanitize_thread::Bool=false, sanitize_address::Bool=false)
198+
sanitize_memory::Bool=false, sanitize_thread::Bool=false, sanitize_address::Bool=false,
199+
unique_names::Bool=false)
192200
return new(
193201
Cint(track_allocations), Cint(code_coverage),
194202
Cint(prefer_specsig),
195203
Cint(gnu_pubnames), debug_info_kind,
196204
debug_info_level, Cint(safepoint_on_entry),
197205
Cint(gcstack_arg), Cint(use_jlplt), Cint(force_emit_all),
198-
Cint(sanitize_memory), Cint(sanitize_thread), Cint(sanitize_address))
206+
Cint(sanitize_memory), Cint(sanitize_thread), Cint(sanitize_address),
207+
Cint(unique_names))
199208
end
200209
end
201210

doc/src/devdocs/locks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ exception frames, and taking/releasing locks.
8686
* `jl_method_t.writelock`
8787
* `typecache_lock`
8888
* `libmap_lock`
89+
* `JuliaOJIT.LinkerMutex` (`std::mutex`)
8990

9091
### Level 4
9192

src/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ $(BUILDDIR)/gc-alloc-profiler.o $(BUILDDIR)/gc-alloc-profiler.dbg.obj: $(SRCDIR)
406406
$(BUILDDIR)/gc-page-profiler.o $(BUILDDIR)/gc-page-profiler.dbg.obj: $(SRCDIR)/gc-page-profiler.h
407407
$(BUILDDIR)/init.o $(BUILDDIR)/init.dbg.obj: $(SRCDIR)/builtin_proto.h
408408
$(BUILDDIR)/interpreter.o $(BUILDDIR)/interpreter.dbg.obj: $(SRCDIR)/builtin_proto.h
409-
$(BUILDDIR)/jitlayers.o $(BUILDDIR)/jitlayers.dbg.obj: $(SRCDIR)/jitlayers.h $(SRCDIR)/llvm-codegen-shared.h $(SRCDIR)/llvm-julia-task-dispatcher.h
409+
$(BUILDDIR)/jitlayers.o $(BUILDDIR)/jitlayers.dbg.obj: $(SRCDIR)/jitlayers.h $(SRCDIR)/llvm-codegen-shared.h $(SRCDIR)/julia-task-dispatcher.h
410410
$(BUILDDIR)/jltypes.o $(BUILDDIR)/jltypes.dbg.obj: $(SRCDIR)/builtin_proto.h
411411
$(build_shlibdir)/libllvmcalltest.$(SHLIB_EXT): $(SRCDIR)/llvm-codegen-shared.h $(BUILDDIR)/julia_version.h
412412
$(BUILDDIR)/llvm-alloc-helpers.o $(BUILDDIR)/llvm-alloc-helpers.dbg.obj: $(SRCDIR)/llvm-codegen-shared.h $(SRCDIR)/llvm-pass-helpers.h $(SRCDIR)/llvm-alloc-helpers.h
@@ -552,7 +552,7 @@ ADDITIONAL_C_HEADERS := builtin_proto.h common_symbols1.inc common_symbols2.inc
552552
support/htable.h support/htable.inc
553553
ADDITIONAL_CXX_HEADERS := debug-registry.h debuginfo.h intrinsics.h jitlayers.h llvm-alloc-helpers.h \
554554
llvm-codegen-shared.h llvm-gc-interface-passes.h llvm-julia-passes.inc \
555-
llvm-julia-task-dispatcher.h llvm-pass-helpers.h passes.h processor.h
555+
julia-task-dispatcher.h llvm-pass-helpers.h passes.h processor.h
556556

557557
# Included files that should be compiled using their including file's compiler settings
558558
INCLUDED_C_FILES := \

src/aotcompile.cpp

Lines changed: 316 additions & 503 deletions
Large diffs are not rendered by default.

src/ccall.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ static bool runtime_sym_gvs(jl_codectx_t &ctx, const native_sym_arg_t &symarg,
9191
return false;
9292
}
9393

94-
auto M = &ctx.emission_context.shared_module();
94+
auto M = &ctx.emission_context.get_module();
9595
bool runtime_lib = false;
9696
GlobalVariable *libptrgv;
97-
jl_codegen_params_t::SymMapGV *symMap;
97+
jl_codegen_output_t::SymMapGV *symMap;
9898
if ((intptr_t)f_lib == (intptr_t)JL_EXE_LIBNAME) {
9999
libptrgv = prepare_global_in(M, jlexe_var);
100100
symMap = &ctx.emission_context.symMapExe;
@@ -147,7 +147,7 @@ static bool runtime_sym_gvs(jl_codectx_t &ctx, const native_sym_arg_t &symarg,
147147
}
148148

149149
static Value *runtime_sym_lookup(
150-
jl_codegen_params_t &emission_context,
150+
jl_codegen_output_t &emission_context,
151151
IRBuilder<> &irbuilder,
152152
jl_codectx_t *pctx,
153153
const native_sym_arg_t &symarg, Function *f,
@@ -265,7 +265,7 @@ static GlobalVariable *emit_plt_thunk(
265265
++PLTThunks;
266266
bool shared = libptrgv != nullptr;
267267
assert(shared && "not yet supported by runtime_sym_lookup");
268-
Module *M = shared ? &ctx.emission_context.shared_module() : jl_Module;
268+
auto M = &ctx.emission_context.get_module();
269269
if (shared) {
270270
assert(symarg.f_name);
271271
libptrgv = prepare_global_in(M, libptrgv);
@@ -1192,7 +1192,7 @@ static jl_cgval_t emit_llvmcall(jl_codectx_t &ctx, jl_value_t **args, size_t nar
11921192
// save the module to be linked later.
11931193
// we cannot do this right now, because linking mutates the destination module,
11941194
// which might invalidate LLVM values cached in cgval_t's (specifically constant arrays)
1195-
ctx.llvmcall_modules.push_back(std::move(Mod));
1195+
ctx.emission_context.llvmcall_modules.push_back(std::move(Mod));
11961196

11971197
JL_GC_POP();
11981198

@@ -1257,9 +1257,9 @@ class function_sig_t {
12571257
jl_unionall_t *unionall_env; // UnionAll environment for `at` and `rt`
12581258
size_t nccallargs; // number of actual arguments
12591259
size_t nreqargs; // number of required arguments in ccall function definition
1260-
jl_codegen_params_t *ctx;
1260+
jl_codegen_output_t *ctx;
12611261

1262-
function_sig_t(const char *fname, Type *lrt, jl_value_t *rt, bool retboxed, bool gc_safe, jl_svec_t *at, jl_unionall_t *unionall_env, size_t nreqargs, CallingConv::ID cc, bool llvmcall, jl_codegen_params_t *ctx)
1262+
function_sig_t(const char *fname, Type *lrt, jl_value_t *rt, bool retboxed, bool gc_safe, jl_svec_t *at, jl_unionall_t *unionall_env, size_t nreqargs, CallingConv::ID cc, bool llvmcall, jl_codegen_output_t *ctx)
12631263
: lrt(lrt), retboxed(retboxed), gc_safe(gc_safe),
12641264
prt(NULL), sret(0), cc(cc), llvmcall(llvmcall),
12651265
at(at), rt(rt), unionall_env(unionall_env),
@@ -1485,7 +1485,7 @@ static bool verify_ref_type(jl_codectx_t &ctx, jl_value_t* ref, jl_unionall_t *u
14851485

14861486
static const std::string verify_ccall_sig(jl_value_t *&rt, jl_value_t *at,
14871487
jl_unionall_t *unionall_env, jl_svec_t *sparam_vals,
1488-
jl_codegen_params_t *ctx,
1488+
jl_codegen_output_t *ctx,
14891489
Type *&lrt, LLVMContext &ctxt,
14901490
bool &retboxed, bool &static_rt, bool llvmcall=false)
14911491
{

src/cgutils.cpp

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ AtomicOrdering get_llvm_atomic_order(enum jl_memory_order order)
146146

147147
// --- string constants ---
148148
static Value *stringConstPtr(
149-
jl_codegen_params_t &emission_context,
149+
jl_codegen_output_t &emission_context,
150150
IRBuilder<> &irbuilder,
151151
const Twine &txt)
152152
{
@@ -229,7 +229,7 @@ static DICompileUnit *getOrCreateJuliaCU(Module &M,
229229
return CU;
230230
}
231231

232-
static DIType *_julia_type_to_di(jl_codegen_params_t *ctx, jl_debugcache_t &debuginfo, jl_value_t *jt, DIBuilder *dbuilder, bool isboxed)
232+
static DIType *_julia_type_to_di(jl_codegen_output_t *ctx, jl_debugcache_t &debuginfo, jl_value_t *jt, DIBuilder *dbuilder, bool isboxed)
233233
{
234234
jl_datatype_t *jdt = (jl_datatype_t*)jt;
235235
if (isboxed || !jl_is_datatype(jt) || !jdt->isconcretetype)
@@ -568,10 +568,10 @@ static llvm::SmallVector<Value*,0> get_gc_roots_for(jl_codectx_t &ctx, const jl_
568568

569569
// --- emitting pointers directly into code ---
570570

571-
static void jl_temporary_root(jl_codegen_params_t &ctx, jl_value_t *val);
571+
static void jl_temporary_root(jl_codegen_output_t &ctx, jl_value_t *val);
572572
static void jl_temporary_root(jl_codectx_t &ctx, jl_value_t *val);
573573

574-
static Constant *julia_pgv(jl_codegen_params_t &params, Module *M, const char *cname, void *addr)
574+
static Constant *julia_pgv(jl_codegen_output_t &params, Module *M, const char *cname, void *addr)
575575
{
576576
// emit a GlobalVariable for a jl_value_t named "cname"
577577
// store the name given so we can reuse it (facilitating merging later)
@@ -580,8 +580,7 @@ static Constant *julia_pgv(jl_codegen_params_t &params, Module *M, const char *c
580580
StringRef localname;
581581
std::string gvname;
582582
if (!gv) {
583-
uint64_t id = jl_atomic_fetch_add_relaxed(&globalUniqueGeneratedNames, 1); // TODO: use params.global_targets.size()
584-
raw_string_ostream(gvname) << cname << id;
583+
gvname = params.make_name(cname);
585584
localname = StringRef(gvname);
586585
}
587586
else {
@@ -603,7 +602,7 @@ static Constant *julia_pgv(jl_codegen_params_t &params, Module *M, const char *c
603602
return gv;
604603
}
605604

606-
static Constant *julia_pgv(jl_codegen_params_t &params, Module *M, const char *prefix, jl_sym_t *name, jl_module_t *mod, void *addr)
605+
static Constant *julia_pgv(jl_codegen_output_t &params, Module *M, const char *prefix, jl_sym_t *name, jl_module_t *mod, void *addr)
607606
{
608607
// emit a GlobalVariable for a jl_value_t, using the prefix, name, and module to
609608
// to create a readable name of the form prefixModA.ModB.name#
@@ -632,8 +631,9 @@ static Constant *julia_pgv(jl_codegen_params_t &params, Module *M, const char *p
632631
}
633632

634633
static JuliaVariable *julia_const_gv(jl_value_t *val);
635-
Constant *literal_pointer_val_slot(jl_codegen_params_t &params, Module *M, jl_value_t *p)
634+
Constant *literal_pointer_val_slot(jl_codegen_output_t &params, jl_value_t *p)
636635
{
636+
Module *M = &params.get_module();
637637
// emit a pointer to a jl_value_t* which will allow it to be valid across reloading code
638638
// also, try to give it a nice name for gdb, for easy identification
639639
if (JuliaVariable *gv = julia_const_gv(p)) {
@@ -743,7 +743,7 @@ static Value *literal_pointer_val(jl_codectx_t &ctx, jl_value_t *p)
743743
{
744744
if (p == NULL)
745745
return Constant::getNullValue(ctx.types().T_pjlvalue);
746-
Value *pgv = literal_pointer_val_slot(ctx.emission_context, jl_Module, p);
746+
Value *pgv = literal_pointer_val_slot(ctx.emission_context, p);
747747
jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA(ctx, ctx.tbaa().tbaa_const);
748748
auto load = ai.decorateInst(maybe_mark_load_dereferenceable(
749749
ctx.builder.CreateAlignedLoad(ctx.types().T_pjlvalue, pgv, Align(sizeof(void*))),
@@ -805,9 +805,9 @@ static unsigned convert_struct_offset(jl_codectx_t &ctx, Type *lty, unsigned byt
805805
return convert_struct_offset(ctx.builder.GetInsertBlock()->getModule()->getDataLayout(), lty, byte_offset);
806806
}
807807

808-
static Type *_julia_struct_to_llvm(jl_codegen_params_t *ctx, LLVMContext &ctxt, jl_value_t *jt, bool *isboxed, bool llvmcall=false);
808+
static Type *_julia_struct_to_llvm(jl_codegen_output_t *ctx, LLVMContext &ctxt, jl_value_t *jt, bool *isboxed, bool llvmcall=false);
809809

810-
static Type *_julia_type_to_llvm(jl_codegen_params_t *ctx, LLVMContext &ctxt, jl_value_t *jt, bool *isboxed, bool no_boxing)
810+
static Type *_julia_type_to_llvm(jl_codegen_output_t *ctx, LLVMContext &ctxt, jl_value_t *jt, bool *isboxed, bool no_boxing)
811811
{
812812
// this function converts a Julia Type into the equivalent LLVM type
813813
if (isboxed) *isboxed = false;
@@ -922,7 +922,7 @@ static StructType *get_memoryref_type(LLVMContext &ctxt, Type *T_size, const jl_
922922
return get_jlmemoryref(ctxt, AS);
923923
}
924924

925-
static Type *_julia_struct_to_llvm(jl_codegen_params_t *ctx, LLVMContext &ctxt, jl_value_t *jt, bool *isboxed, bool llvmcall)
925+
static Type *_julia_struct_to_llvm(jl_codegen_output_t *ctx, LLVMContext &ctxt, jl_value_t *jt, bool *isboxed, bool llvmcall)
926926
{
927927
// this function converts a Julia Type into the equivalent LLVM struct
928928
// use this where C-compatible (unboxed) structs are desired
@@ -1505,7 +1505,7 @@ static Value *emit_typeof(jl_codectx_t &ctx, const jl_cgval_t &p, bool maybenull
15051505
ptr = get_pointer_to_constant(ctx.emission_context, ConstantInt::get(expr_type, jt->smalltag << 4), Align(sizeof(jl_value_t*)), StringRef("_j_smalltag_") + jl_symbol_name(jt->name->name), *jl_Module);
15061506
}
15071507
else {
1508-
ptr = ConstantExpr::getBitCast(literal_pointer_val_slot(ctx.emission_context, jl_Module, (jl_value_t*)jt), datatype_or_p->getType());
1508+
ptr = ConstantExpr::getBitCast(literal_pointer_val_slot(ctx.emission_context, (jl_value_t*)jt), datatype_or_p->getType());
15091509
}
15101510
datatype_or_p = ctx.builder.CreateSelect(cmp, ptr, datatype_or_p);
15111511
setName(ctx.emission_context, datatype_or_p, "typetag_ptr");
@@ -4708,22 +4708,6 @@ static Value *emit_defer_signal(jl_codectx_t &ctx)
47084708
return emit_ptrgep(ctx, ptls, offsetof(jl_tls_states_t, defer_signal));
47094709
}
47104710

4711-
#ifndef JL_NDEBUG
4712-
static int compare_cgparams(const jl_cgparams_t *a, const jl_cgparams_t *b)
4713-
{
4714-
return
4715-
(a->track_allocations == b->track_allocations) &&
4716-
(a->code_coverage == b->code_coverage) &&
4717-
(a->prefer_specsig == b->prefer_specsig) &&
4718-
(a->gnu_pubnames == b->gnu_pubnames) &&
4719-
(a->debug_info_kind == b->debug_info_kind) &&
4720-
(a->safepoint_on_entry == b->safepoint_on_entry) &&
4721-
(a->gcstack_arg == b->gcstack_arg) &&
4722-
(a->use_jlplt == b->use_jlplt) &&
4723-
(a->force_emit_all == b->force_emit_all);
4724-
}
4725-
#endif
4726-
47274711
// Emit allocation for variable-length GenericMemory
47284712
// If zeroinit_nbytes is non-null, adds a zeroinit_indirect bundle to zero that many bytes
47294713
// via the data pointer (at offset 8 in the memory header)

src/codegen-stubs.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ JL_DLLEXPORT size_t jl_jit_total_bytes_fallback(void)
8888
return 0;
8989
}
9090

91+
JL_DLLEXPORT void jl_jit_register_ci_fallback(jl_code_instance_t *ci)
92+
{
93+
}
94+
95+
JL_DLLEXPORT void jl_jit_unregister_ci_fallback(jl_code_instance_t *ci)
96+
{
97+
}
98+
9199
JL_DLLEXPORT void *jl_create_native_fallback(LLVMOrcThreadSafeModuleRef llvmmod, int _trim, int _external_linkage, size_t _world, jl_array_t *_mod_array, jl_array_t *_worklist, int _all, jl_array_t *_module_init_order) UNAVAILABLE
92100
JL_DLLEXPORT void *jl_emit_native_fallback(jl_array_t *codeinfos, LLVMOrcThreadSafeModuleRef llvmmod, const jl_cgparams_t *cgparams, int _external_linkage) UNAVAILABLE
93101

0 commit comments

Comments
 (0)