Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor cleanups #557

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions src/interpreter.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using .CC: AbstractInterpreter, NativeInterpreter, InferenceState, OptimizationState,
CodeInfo, CodeInstance, InferenceResult, WorldRange, WorldView, IRCode, SSAValue,
CallInfo as CCCallInfo, NoCallInfo
using .CC: AbstractInterpreter, CallInfo as CCCallInfo, CodeInfo, CodeInstance,
InferenceParams, InferenceResult, InferenceState, IRCode, NativeInterpreter,
NoCallInfo, OptimizationParams, OptimizationState, SSAValue, WorldRange, WorldView

struct InferredSource
src::CodeInfo
Expand Down Expand Up @@ -48,11 +48,6 @@ function CthulhuInterpreter(interp::AbstractInterpreter=NativeInterpreter())
InferenceDict{PC2Excts}())
end

import .CC: InferenceParams, OptimizationParams, #=get_inference_world,=#
get_inference_cache, code_cache, lock_mi_inference, unlock_mi_inference, method_table,
inlining_policy
using Base: @invoke

CC.InferenceParams(interp::CthulhuInterpreter) = InferenceParams(interp.native)
@static if VERSION ≥ v"1.11.0-DEV.851"
CC.OptimizationParams(interp::CthulhuInterpreter) =
Expand All @@ -61,14 +56,14 @@ else
CC.OptimizationParams(interp::CthulhuInterpreter) = OptimizationParams(interp.native)
end
#=CC.=#get_inference_world(interp::CthulhuInterpreter) = get_inference_world(interp.native)
CC.get_inference_cache(interp::CthulhuInterpreter) = get_inference_cache(interp.native)
CC.get_inference_cache(interp::CthulhuInterpreter) = CC.get_inference_cache(interp.native)

CC.may_optimize(interp::CthulhuInterpreter) = true
CC.may_compress(interp::CthulhuInterpreter) = false
CC.may_discard_trees(interp::CthulhuInterpreter) = false
CC.verbose_stmt_info(interp::CthulhuInterpreter) = true

CC.method_table(interp::CthulhuInterpreter) = method_table(interp.native)
CC.method_table(interp::CthulhuInterpreter) = CC.method_table(interp.native)

@static if VERSION ≥ v"1.11.0-DEV.1552"
# Since the cache for `CthulhuInterpreter` is volatile and does not involve with the
Expand Down Expand Up @@ -159,7 +154,7 @@ function CC.src_inlining_policy(interp::CthulhuInterpreter,
end
end
CC.retrieve_ir_for_inlining(cached_result::CodeInstance, src::OptimizedSource) = CC.copy(src.ir)
CC.retrieve_ir_for_inlining(mi::Core.MethodInstance, src::OptimizedSource, preserve_local_sources::Bool) =
CC.retrieve_ir_for_inlining(mi::MethodInstance, src::OptimizedSource, preserve_local_sources::Bool) =
CC.retrieve_ir_for_inlining(mi, src.ir, preserve_local_sources)
elseif VERSION ≥ v"1.11.0-DEV.879"
function CC.inlining_policy(interp::CthulhuInterpreter,
Expand Down
Loading