Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Nov 7, 2023
1 parent 43f52ca commit 264f2ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/interpreter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ import .CC: InferenceParams, OptimizationParams, get_world_counter,
using Base: @invoke

CC.InferenceParams(interp::CthulhuInterpreter) = InferenceParams(interp.native)
@static if VERSION v"1.11.0-DEV.851"
CC.OptimizationParams(interp::CthulhuInterpreter) = OptimizationParams(interp.native;
preserve_local_sources=true)
else
CC.OptimizationParams(interp::CthulhuInterpreter) = OptimizationParams(interp.native)
end
CC.get_world_counter(interp::CthulhuInterpreter) = get_world_counter(interp.native)
CC.get_inference_cache(interp::CthulhuInterpreter) = get_inference_cache(interp.native)

Expand Down
4 changes: 4 additions & 0 deletions src/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ function process_const_info(interp::AbstractInterpreter, @nospecialize(thisinfo)

if isnothing(result)
return thisinfo
elseif (@static VERSION v"1.11.0-DEV.851" && true) && result isa CC.VolatileInferenceResult
# NOTE we would not hit this case since `finish!(::CthulhuInterpreter, frame::InferenceState)`
# will always transform `frame.result.src` to `OptimizedSource` when frame is inferred
return thisinfo
elseif (@static VERSION v"1.9-" && true) && isa(result, CC.ConcreteResult)
linfo = result.mi
effects = get_effects(result)
Expand Down

0 comments on commit 264f2ec

Please sign in to comment.