Skip to content

Commit

Permalink
Don't report only-inferred methods as recompiles (#56914)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6e28217)
  • Loading branch information
IanButterworth committed Jan 3, 2025
1 parent 568b192 commit 56c7c58
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/jitlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,15 @@ jl_code_instance_t *jl_generate_fptr_impl(jl_method_instance_t *mi JL_PROPAGATES
}
else {
// identify whether this is an invalidated method that is being recompiled
is_recompile = jl_atomic_load_relaxed(&mi->cache) != NULL;
// Is a recompile if there is cached code, and it was compiled (not only inferred) before
jl_code_instance_t *codeinst_old = jl_atomic_load_relaxed(&mi->cache);
while (codeinst_old != NULL) {
if (jl_atomic_load_relaxed(&codeinst_old->invoke) != NULL) {
is_recompile = 1;
break;
}
codeinst_old = jl_atomic_load_relaxed(&codeinst_old->next);
}
}
if (src == NULL && jl_is_method(mi->def.method) &&
jl_symbol_name(mi->def.method->name)[0] != '@') {
Expand Down

0 comments on commit 56c7c58

Please sign in to comment.