Skip to content

Commit 2adb588

Browse files
sjkellykpamnany
authored andcommitted
Ignore inlining costs for precompilation with --compile=all (JuliaLang#53798)
This helps to minimize the amount of missed precompiles that occur by eliding the inlining cost check when julia is run under `--compile=all`. This will lead to slightly larger sysimage sizes. However, in practice it leads to more extensive and successful precompilation, which can minimize the number of JIT events in call sites with dynamic dispatch. This is an alternative to JuliaLang#53547, where removing the inlining cost check was made universal. However, that lead to ~15% larger sysimage sizes by default. This implements Jeff's suggestion that this mode be enabled under `--compile=all`.
1 parent 494de59 commit 2adb588

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/precompile_utils.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@ static int precompile_enq_specialization_(jl_method_instance_t *mi, void *closur
186186
jl_value_t *inferred = jl_atomic_load_relaxed(&codeinst->inferred);
187187
if (inferred &&
188188
inferred != jl_nothing &&
189-
jl_ir_flag_inferred(inferred) &&
190-
(jl_ir_inlining_cost(inferred) == UINT16_MAX)) {
189+
(jl_options.compile_enabled != JL_OPTIONS_COMPILE_ALL || jl_ir_inlining_cost(inferred) == UINT16_MAX)) {
191190
do_compile = 1;
192191
}
193192
else if (jl_atomic_load_relaxed(&codeinst->invoke) != NULL || jl_atomic_load_relaxed(&codeinst->precompile)) {

0 commit comments

Comments
 (0)