|
253 | 253 |
|
254 | 254 | CC.InferenceParams(ei::ADInterpreter) = InferenceParams(ei.native_interpreter) |
255 | 255 | CC.OptimizationParams(ei::ADInterpreter) = OptimizationParams(ei.native_interpreter) |
256 | | -CC.get_world_counter(ei::ADInterpreter) = get_world_counter(ei.native_interpreter) |
| 256 | +#=CC.=#get_inference_world(ei::ADInterpreter) = get_inference_world(ei.native_interpreter) |
257 | 257 | CC.get_inference_cache(ei::ADInterpreter) = get_inference_cache(ei.native_interpreter) |
258 | 258 |
|
259 | 259 | # No need to do any locking since we're not putting our results into the runtime cache |
@@ -325,15 +325,6 @@ function CC.inlining_policy(interp::ADInterpreter, |
325 | 325 | mi::MethodInstance, argtypes::Vector{Any}) |
326 | 326 | end |
327 | 327 |
|
328 | | -# TODO remove this overload once https://github.com/JuliaLang/julia/pull/49191 gets merged |
329 | | -function CC.abstract_call_gf_by_type(interp::ADInterpreter, @nospecialize(f), |
330 | | - arginfo::ArgInfo, si::StmtInfo, @nospecialize(atype), |
331 | | - sv::IRInterpretationState, max_methods::Int) |
332 | | - return @invoke CC.abstract_call_gf_by_type(interp::AbstractInterpreter, f::Any, |
333 | | - arginfo::ArgInfo, si::StmtInfo, atype::Any, |
334 | | - sv::CC.AbsIntState, max_methods::Int) |
335 | | -end |
336 | | - |
337 | 328 | #= |
338 | 329 | function CC.optimize(interp::ADInterpreter, opt::OptimizationState, |
339 | 330 | params::OptimizationParams, caller::InferenceResult) |
@@ -362,6 +353,17 @@ else |
362 | 353 | CC.finish!(::ADInterpreter, caller::InferenceResult) = _finish!(caller) |
363 | 354 | end |
364 | 355 |
|
| 356 | +@static if VERSION ≥ v"1.11.0-DEV.1278" |
| 357 | +function CC.bail_out_const_call(interp::ADInterpreter, result::CC.MethodCallResult, |
| 358 | + si::StmtInfo, sv::CC.AbsIntState) |
| 359 | + if result.rt isa CC.LimitedAccuracy |
| 360 | + return false |
| 361 | + end |
| 362 | + return @invoke CC.bail_out_const_call(interp::AbstractInterpreter, result::CC.MethodCallResult, |
| 363 | + si::StmtInfo, sv::CC.AbsIntState) |
| 364 | +end |
| 365 | +end |
| 366 | + |
365 | 367 | function ir2codeinst(ir::IRCode, inst::CodeInstance, ci::CodeInfo) |
366 | 368 | CodeInstance(inst.def, inst.rettype, isdefined(inst, :rettype_const) ? inst.rettype_const : nothing, |
367 | 369 | Cthulhu.OptimizedSource(CC.copy(ir), ci, inst.inferred.isinlineable, CC.decode_effects(inst.purity_bits)), |
|
0 commit comments