Skip to content

Commit

Permalink
Don't bailout on no-value phinodes to fix illegal instruction problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Atol committed Apr 28, 2022
1 parent e3cb70e commit 9d5a93a
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 @@ -314,7 +314,7 @@ function _ir_abstract_constant_propagation(interp::AbstractInterpreter, mi_cache
if idx == lstmt && process_terminator!(ip, bb, idx)
@goto residual_scan
end
if ir.stmts[idx][:type] === Bottom
if typ === Bottom && !isa(inst, PhiNode)
break
end
end
Expand All @@ -330,7 +330,6 @@ function _ir_abstract_constant_propagation(interp::AbstractInterpreter, mi_cache
lstmt = last(stmts)
for idx = stmts
inst = ir.stmts[idx][:inst]
typ = ir.stmts[idx][:type]
for ur in userefs(inst)
val = ur[]
if isa(val, Argument)
Expand All @@ -354,7 +353,6 @@ function _ir_abstract_constant_propagation(interp::AbstractInterpreter, mi_cache
lstmt = last(stmts)
for idx = stmts
inst = ir.stmts[idx][:inst]
typ = ir.stmts[idx][:type]
for ur in userefs(inst)
val = ur[]
if isa(val, SSAValue)
Expand Down Expand Up @@ -391,7 +389,8 @@ function _ir_abstract_constant_propagation(interp::AbstractInterpreter, mi_cache
continue
end
inst = ir.stmts[idx][:inst]
ultimate_rt = tmerge(ultimate_rt, argextype(inst.val, ir))
rt = argextype(inst.val, ir)
ultimate_rt = tmerge(ultimate_rt, rt)
end
return ultimate_rt
end
Expand All @@ -405,6 +404,7 @@ function ir_abstract_constant_propagation(interp::AbstractInterpreter, mi_cache,
Timings.exit_current_timer(inf_frame)
return v
else
return _ir_abstract_constant_propagation(interp, mi_cache, frame, mi, ir, argtypes)
T = _ir_abstract_constant_propagation(interp, mi_cache, frame, mi, ir, argtypes)
return T
end
end

0 comments on commit 9d5a93a

Please sign in to comment.