@@ -25,7 +25,7 @@ function extract_inner_call!(stmt::Expr, idx, once::Bool=false)
2525 return nothing
2626end
2727
28- function replace_ssa! (stmt, ssalookup)
28+ function replace_ssa! (@nospecialize ( stmt) , ssalookup)
2929 isa (stmt, Expr) || return nothing
3030 for (i, a) in enumerate (stmt. args)
3131 if isa (a, SSAValue)
@@ -59,7 +59,7 @@ function renumber_ssa!(stmts::Vector{Any}, ssalookup)
5959 stmt. args[end ] = jumplookup (ssalookup, stmt. args[end ])
6060 end
6161 elseif is_GotoIfNot (stmt)
62- cond = stmt. cond
62+ cond = ( stmt:: Core.GotoIfNot ) . cond
6363 if isa (cond, SSAValue)
6464 cond = SSAValue (ssalookup[cond. id])
6565 end
@@ -245,15 +245,15 @@ function optimize!(code::CodeInfo, scope)
245245 return code, methodtables
246246end
247247
248- function parametric_type_to_expr (t:: Type )
248+ function parametric_type_to_expr (@nospecialize ( t:: Type ) )
249249 t isa Core. TypeofBottom && return t
250250 t isa UnionAll && (t = t. body)
251251 t = t:: DataType
252252 if Base. isvarargtype (t)
253253 return Expr (:(... ), t. parameters[1 ])
254254 end
255255 if t. hasfreetypevars
256- params = map (t. parameters) do p
256+ params = map (t. parameters) do @nospecialize (p)
257257 isa (p, TypeVar) ? p. name :
258258 isa (p, DataType) && p. hasfreetypevars ? parametric_type_to_expr (p) : p
259259 end
@@ -403,10 +403,18 @@ end
403403
404404function replace_coretypes_list! (list:: AbstractVector ; rev:: Bool )
405405 function rep (@nospecialize (x), rev:: Bool )
406- if isa (x, rev ? SSAValue : Core. SSAValue)
407- return rev ? Core. SSAValue (x. id) : SSAValue (x. id)
408- elseif isa (x, rev ? SlotNumber : Core. SlotNumber)
409- return rev ? Core. SlotNumber (x. id) : SlotNumber (x. id)
406+ if rev
407+ if isa (x, SSAValue)
408+ return Core. SSAValue (x. id)
409+ elseif isa (x, SlotNumber)
410+ return Core. SlotNumber (x. id)
411+ end
412+ return x
413+ end
414+ if isa (x, Core. SSAValue)
415+ return SSAValue (x. id)
416+ elseif isa (x, Core. SlotNumber)
417+ return SlotNumber (x. id)
410418 end
411419 return x
412420 end
0 commit comments