Skip to content

Commit c0611e8

Browse files
authored
Allow PrecompileTools to see MI's inferred by foreign abstract interpreters (#54069)
Partially reverts #49391 PrecompileTools uses the timing infrastructure to snoop on the inference process. The reason for #49391 was that this could lead to accidental pollution of the caches with foreign results (timholy/SnoopCompile.jl#338) After #52233 and especially #53336 we now filter results by cache owner and don't try to cache foreign code using the native pipeline. Motivated by JuliaGPU/GPUCompiler.jl#567 which demonstrated that a foreign code instance would not be cached without PrecompileTools.
1 parent 9de150c commit c0611e8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

base/compiler/typeinfer.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,8 @@ If set to `true`, record per-method-instance timings within type inference in th
204204
__set_measure_typeinf(onoff::Bool) = __measure_typeinf__[] = onoff
205205
const __measure_typeinf__ = fill(false)
206206

207-
# Wrapper around `_typeinf` that optionally records the exclusive time for
208-
# each inference performed by `NativeInterpreter`.
209-
function typeinf(interp::NativeInterpreter, frame::InferenceState)
207+
# Wrapper around `_typeinf` that optionally records the exclusive time for each invocation.
208+
function typeinf(interp::AbstractInterpreter, frame::InferenceState)
210209
if __measure_typeinf__[]
211210
Timings.enter_new_timer(frame)
212211
v = _typeinf(interp, frame)
@@ -216,7 +215,6 @@ function typeinf(interp::NativeInterpreter, frame::InferenceState)
216215
return _typeinf(interp, frame)
217216
end
218217
end
219-
typeinf(interp::AbstractInterpreter, frame::InferenceState) = _typeinf(interp, frame)
220218

221219
function finish!(interp::AbstractInterpreter, caller::InferenceState)
222220
result = caller.result

0 commit comments

Comments
 (0)