Skip to content

Commit

Permalink
Adjust to upstream edges change (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno authored Nov 12, 2024
1 parent 1cbde03 commit 06cb7dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/analysis/forward.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,11 @@ function fwd_abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize
frc = frule_call[]
pc = primal_call[]

if frc.rt !== Const(nothing)
result[] = CallMeta(pc.rt, pc.exct, pc.effects, FRuleCallInfo(pc.info, frc))
else
result[] = pc
if VERSION < v"1.12.0-DEV.1531" && frc.rt === Const(nothing)
CC.add_mt_backedge!(sv, frule_mt, frule_atype)
end

result[] = CallMeta(pc.rt, pc.exct, pc.effects, FRuleCallInfo(pc.info, frc))
return true
end
(!isready(primal_call) || !make_progress(interp, sv)) && push!(sv.tasks, make_progress)
Expand Down Expand Up @@ -89,7 +87,7 @@ function fwd_abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize
@static if VERSION v"1.11.0-DEV.945"
return CallMeta(primal_call.rt, primal_call.exct, primal_call.effects, FRuleCallInfo(primal_call.info, frule_call))
else
return CallMeta(primal_call.rt, primal_call.effects, FRuleCallInfo(primal_call.info, frule_call))
return CallMeta(primal_call.rt, primal_call.effects, FRuleCallInfo(primal_call.info, frule_call.info))
end
else
CC.add_mt_backedge!(sv, frule_mt, frule_atype)
Expand Down
10 changes: 9 additions & 1 deletion src/stage2/lattice.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,22 @@ end
struct FRuleCallInfo <: CallInfo
info::CallInfo
frule_call::CallMeta
FRuleCallInfo(@nospecialize(info::CallInfo), frule_call::CallMeta) = new(info, frule_call)
function FRuleCallInfo(@nospecialize(info::CallInfo), frule_call::CallMeta)
new(info, frule_call)
end
end
CC.nsplit_impl(info::FRuleCallInfo) = CC.nsplit(info.info)
CC.getsplit_impl(info::FRuleCallInfo, idx::Int) = CC.getsplit(info.info, idx)
CC.getresult_impl(info::FRuleCallInfo, idx::Int) = CC.getresult(info.info, idx)
if isdefined(CC, :add_uncovered_edges_impl)
CC.add_uncovered_edges_impl(edges::Vector{Any}, info::FRuleCallInfo, @nospecialize(atype)) = CC.add_uncovered_edges!(edges, info.info, atype)
end
if isdefined(CC, :add_edges_impl)
function CC.add_edges_impl(edges::Vector{Any}, info::FRuleCallInfo)
CC.add_edges!(edges, info.info)
CC.add_edges!(edges, info.frule_call.info)
end
end

function Base.show(io::IO, info::FRuleCallInfo)
print(io, "FRuleCallInfo(", typeof(info.info), ", ", typeof(info.frule_call.info), ")")
Expand Down

0 comments on commit 06cb7dd

Please sign in to comment.