Skip to content

Commit

Permalink
irinterp: use optimizer_lattice (#48412)
Browse files Browse the repository at this point in the history
Previously it uses `typeinf_lattice`, but it should use
`optimizer_lattice` instead since irinterp is working on `IRCode`
and otherwise it fails to handle `MaybeUndef`.
  • Loading branch information
aviatesk authored Jan 26, 2023
1 parent b6db2fd commit 1a0b92c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions base/compiler/ssair/irinterp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ struct IRInterpretationState
lazydomtree::LazyDomtree
function IRInterpretationState(interp::AbstractInterpreter,
ir::IRCode, mi::MethodInstance, world::UInt, argtypes::Vector{Any})
argtypes = va_process_argtypes(typeinf_lattice(interp), argtypes, mi)
argtypes = va_process_argtypes(optimizer_lattice(interp), argtypes, mi)
for i = 1:length(argtypes)
argtypes[i] = widenslotwrapper(argtypes[i])
end
argtypes_refined = Bool[!(typeinf_lattice(interp), ir.argtypes[i], argtypes[i]) for i = 1:length(argtypes)]
argtypes_refined = Bool[!(optimizer_lattice(interp), ir.argtypes[i], argtypes[i]) for i = 1:length(argtypes)]
empty!(ir.argtypes)
append!(ir.argtypes, argtypes)
tpdum = TwoPhaseDefUseMap(length(ir.stmts))
Expand Down Expand Up @@ -268,7 +268,7 @@ function reprocess_instruction!(interp::AbstractInterpreter,
# Handled at the very end
return false
elseif isa(inst, PiNode)
rt = tmeet(typeinf_lattice(interp), argextype(inst.val, ir), widenconst(inst.typ))
rt = tmeet(optimizer_lattice(interp), argextype(inst.val, ir), widenconst(inst.typ))
elseif inst === nothing
return false
elseif isa(inst, GlobalRef)
Expand All @@ -277,7 +277,7 @@ function reprocess_instruction!(interp::AbstractInterpreter,
ccall(:jl_, Cvoid, (Any,), inst)
error()
end
if rt !== nothing && !(typeinf_lattice(interp), typ, rt)
if rt !== nothing && !(optimizer_lattice(interp), typ, rt)
ir.stmts[idx][:type] = rt
return true
end
Expand Down Expand Up @@ -444,7 +444,7 @@ function _ir_abstract_constant_propagation(interp::AbstractInterpreter, irsv::IR
end
inst = ir.stmts[idx][:inst]::ReturnNode
rt = argextype(inst.val, ir)
ultimate_rt = tmerge(typeinf_lattice(interp), ultimate_rt, rt)
ultimate_rt = tmerge(optimizer_lattice(interp), ultimate_rt, rt)
end
end

Expand Down

2 comments on commit 1a0b92c

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected.
A full report can be found here.

Please sign in to comment.