@@ -54,10 +54,8 @@ function Compiler.transform_result_for_cache(interp::SplitCacheInterp, result::C
5454 isexpr (stmt, :call ) || continue
5555 f = stmt. args[1 ]
5656 f === override && continue
57- if isa (f, GlobalRef)
58- T = widenconst (argextype (f, ir))
59- T <: Core.Builtin && continue
60- end
57+ T = widenconst (argextype (f, ir))
58+ T <: Core.Builtin && continue
6159 insert! (stmt. args, 1 , override)
6260 insert! (stmt. args, 3 , interp. owner)
6361 end
6765with_new_compiler (f, args... ; owner:: SplitCacheOwner = SplitCacheOwner ()) = with_new_compiler (f, owner, args... )
6866
6967function with_new_compiler (f, owner:: SplitCacheOwner , args... )
68+ # We try to avoid introducing `with_new_compiler` in the first place,
69+ # but if we can't see the type, it's still possible to end up with a
70+ # builtin here - simply forward to the ordinary builtin call.
71+ isa (f, Core. Builtin) && return f (args... )
7072 mi = lookup_method_instance (f, args... )
7173 new_compiler_ci = Core. OptimizedGenerics. CompilerPlugins. typeinf (
7274 owner, mi, Compiler. SOURCE_MODE_ABI
0 commit comments