Skip to content

Commit

Permalink
precompile: Ensure CI has inference results available for `jl_create_…
Browse files Browse the repository at this point in the history
…native` (JuliaLang#55528)

`jl_emit_codeinst` expects inference results to be available, so
`jl_ci_cache_lookup` needs to provide a CI that has them.

I noticed this because it was causing missing code when, e.g., compiling
`NetworkOptions.__init__` using `--trim` (JuliaLang#55047). Unfortunately
`jl_emit_codeinst` failures are silently ignored (they just leave the
LLVM module empty), so it was easy to miss that the looked-up CIs
sometimes fail to compile.
  • Loading branch information
topolarity authored Aug 28, 2024
1 parent ec2d696 commit 378f192
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/aotcompile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ jl_code_instance_t *jl_ci_cache_lookup(const jl_cgparams_t &cgparams, jl_method_
jl_value_t *ci = cgparams.lookup(mi, world, world);
JL_GC_PROMISE_ROOTED(ci);
jl_code_instance_t *codeinst = NULL;
if (ci != jl_nothing) {
if (ci != jl_nothing && jl_atomic_load_relaxed(&((jl_code_instance_t *)ci)->inferred) != jl_nothing) {
codeinst = (jl_code_instance_t*)ci;
}
else {
Expand Down

0 comments on commit 378f192

Please sign in to comment.