Skip to content

Commit

Permalink
More compiler adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Oct 11, 2024
1 parent 35c7636 commit 2463325
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Manifest.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/analysis/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,8 @@ end
record_ir!(debug_config, "pre_incidence_propagation", ir)

# TODO better work here?
method_info = CC.MethodInfo(#=propagate_inbounds=#true, nothing)
(nargs, isva) = isa(mi.def, Method) ? (mi.def.nargs, mi.def.isva) : (0, false)
method_info = CC.SpecInfo(nargs, isva, #=propagate_inbounds=#true, nothing)
min_world = world = get_inference_world(interp)
max_world = get_world_counter()
if caller !== nothing
Expand Down
21 changes: 7 additions & 14 deletions src/analysis/interpreter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,7 @@ widenincidence(@nospecialize(x)) = x
end
end
arginfo = ArgInfo(arginfo.fargs, map(widenincidence, arginfo.argtypes))
r = Diffractor.fwd_abstract_call_gf_by_type(interp, f, arginfo, si, sv, ret)
return Future{CallMeta}(CC.isready(r) ? ret : r, interp, sv) do _, interp, sv
r[] !== nothing && return r[]
return ret[]
end
return Diffractor.fwd_abstract_call_gf_by_type(interp, f, arginfo, si, sv, ret)
end

@override function CC.abstract_call_method(interp::DAEInterpreter,
Expand Down Expand Up @@ -447,9 +443,9 @@ end

# TODO propagate debug configurations here
@override function CC.optimize(interp::DAEInterpreter, opt::OptimizationState, caller::InferenceResult)
ir = CC.run_passes_ipo_safe(opt.src, opt, caller)
ir = CC.run_passes_ipo_safe(opt.src, opt)
ir = run_dae_passes(interp, ir)
CC.ipo_dataflow_analysis!(interp, ir, caller)
CC.ipo_dataflow_analysis!(interp, opt, ir, caller)
if interp.ipo_analysis_mode
result = ipo_dae_analysis!(interp, ir, caller.linfo, caller)
if result !== nothing
Expand Down Expand Up @@ -528,14 +524,10 @@ end
src === nothing && return nothing
(; inferred, ir) = src::DAECache
(isa(inferred, CodeInfo) && isa(ir, IRCode)) || return nothing
method_info = CC.MethodInfo(inferred)
method_info = CC.SpecInfo(inferred)
ir = copy(ir)
(; min_world, max_world) = inferred
if Base.__has_internal_change(v"1.12-alpha", :codeinfonargs)
argtypes = CC.va_process_argtypes(CC.optimizer_lattice(interp), argtypes, inferred.nargs, inferred.isva)
elseif VERSION >= v"1.12.0-DEV.341"
argtypes = CC.va_process_argtypes(CC.optimizer_lattice(interp), argtypes, mi)
end
argtypes = CC.va_process_argtypes(CC.optimizer_lattice(interp), argtypes, inferred.nargs, inferred.isva)
return IRInterpretationState(interp, method_info, ir, mi, argtypes,
world, min_world, max_world)
end
Expand Down Expand Up @@ -1224,7 +1216,8 @@ function infer_ir!(ir, interp::AbstractInterpreter, mi::MethodInstance)
end
end

method_info = CC.MethodInfo(#=propagate_inbounds=#true, nothing)
(nargs, isva) = isa(mi.def, Method) ? (mi.def.nargs, mi.def.isva) : (0, false)
method_info = CC.SpecInfo(nargs, isva, #=propagate_inbounds=#true, nothing)
min_world = world = get_inference_world(interp)
max_world = get_world_counter()
irsv = IRInterpretationState(interp, method_info, ir, mi, ir.argtypes, world, min_world, max_world)
Expand Down
2 changes: 1 addition & 1 deletion src/transform/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function remap_info(remap_ir!, info)
if isa(result, CC.SemiConcreteResult)
let ir = copy(result.ir)
remap_ir!(ir)
CC.SemiConcreteResult(result.mi, ir, result.effects)
CC.SemiConcreteResult(result.mi, ir, result.effects, result.spec_info)
end
elseif isa(result, CC.ConstPropResult)
if isa(result.result.src, DAECache)
Expand Down

0 comments on commit 2463325

Please sign in to comment.