Skip to content

Commit 2463325

Browse files
committed
More compiler adjust
1 parent 35c7636 commit 2463325

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

Manifest.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/analysis/compiler.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,8 @@ end
717717
record_ir!(debug_config, "pre_incidence_propagation", ir)
718718

719719
# TODO better work here?
720-
method_info = CC.MethodInfo(#=propagate_inbounds=#true, nothing)
720+
(nargs, isva) = isa(mi.def, Method) ? (mi.def.nargs, mi.def.isva) : (0, false)
721+
method_info = CC.SpecInfo(nargs, isva, #=propagate_inbounds=#true, nothing)
721722
min_world = world = get_inference_world(interp)
722723
max_world = get_world_counter()
723724
if caller !== nothing

src/analysis/interpreter.jl

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,7 @@ widenincidence(@nospecialize(x)) = x
305305
end
306306
end
307307
arginfo = ArgInfo(arginfo.fargs, map(widenincidence, arginfo.argtypes))
308-
r = Diffractor.fwd_abstract_call_gf_by_type(interp, f, arginfo, si, sv, ret)
309-
return Future{CallMeta}(CC.isready(r) ? ret : r, interp, sv) do _, interp, sv
310-
r[] !== nothing && return r[]
311-
return ret[]
312-
end
308+
return Diffractor.fwd_abstract_call_gf_by_type(interp, f, arginfo, si, sv, ret)
313309
end
314310

315311
@override function CC.abstract_call_method(interp::DAEInterpreter,
@@ -447,9 +443,9 @@ end
447443

448444
# TODO propagate debug configurations here
449445
@override function CC.optimize(interp::DAEInterpreter, opt::OptimizationState, caller::InferenceResult)
450-
ir = CC.run_passes_ipo_safe(opt.src, opt, caller)
446+
ir = CC.run_passes_ipo_safe(opt.src, opt)
451447
ir = run_dae_passes(interp, ir)
452-
CC.ipo_dataflow_analysis!(interp, ir, caller)
448+
CC.ipo_dataflow_analysis!(interp, opt, ir, caller)
453449
if interp.ipo_analysis_mode
454450
result = ipo_dae_analysis!(interp, ir, caller.linfo, caller)
455451
if result !== nothing
@@ -528,14 +524,10 @@ end
528524
src === nothing && return nothing
529525
(; inferred, ir) = src::DAECache
530526
(isa(inferred, CodeInfo) && isa(ir, IRCode)) || return nothing
531-
method_info = CC.MethodInfo(inferred)
527+
method_info = CC.SpecInfo(inferred)
532528
ir = copy(ir)
533529
(; min_world, max_world) = inferred
534-
if Base.__has_internal_change(v"1.12-alpha", :codeinfonargs)
535-
argtypes = CC.va_process_argtypes(CC.optimizer_lattice(interp), argtypes, inferred.nargs, inferred.isva)
536-
elseif VERSION >= v"1.12.0-DEV.341"
537-
argtypes = CC.va_process_argtypes(CC.optimizer_lattice(interp), argtypes, mi)
538-
end
530+
argtypes = CC.va_process_argtypes(CC.optimizer_lattice(interp), argtypes, inferred.nargs, inferred.isva)
539531
return IRInterpretationState(interp, method_info, ir, mi, argtypes,
540532
world, min_world, max_world)
541533
end
@@ -1224,7 +1216,8 @@ function infer_ir!(ir, interp::AbstractInterpreter, mi::MethodInstance)
12241216
end
12251217
end
12261218

1227-
method_info = CC.MethodInfo(#=propagate_inbounds=#true, nothing)
1219+
(nargs, isva) = isa(mi.def, Method) ? (mi.def.nargs, mi.def.isva) : (0, false)
1220+
method_info = CC.SpecInfo(nargs, isva, #=propagate_inbounds=#true, nothing)
12281221
min_world = world = get_inference_world(interp)
12291222
max_world = get_world_counter()
12301223
irsv = IRInterpretationState(interp, method_info, ir, mi, ir.argtypes, world, min_world, max_world)

src/transform/common.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function remap_info(remap_ir!, info)
5757
if isa(result, CC.SemiConcreteResult)
5858
let ir = copy(result.ir)
5959
remap_ir!(ir)
60-
CC.SemiConcreteResult(result.mi, ir, result.effects)
60+
CC.SemiConcreteResult(result.mi, ir, result.effects, result.spec_info)
6161
end
6262
elseif isa(result, CC.ConstPropResult)
6363
if isa(result.result.src, DAECache)

0 commit comments

Comments
 (0)