You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it intentional that we display the unused slots z@_8, z@_9 and z@_10 and their NewvarNodes here? Or should that have been cleaned up before printing?
julia>functionfoo(x, y)
z = x + y
while z <4
z +=1end
u = (x -> x + z)(x)
v =Ref{Union{Int, Missing}}(x)[] + y
return z *7end
foo (generic function with 1 method)
julia>@code_warntypefoo(1, 2)
MethodInstance forfoo(::Int64, ::Int64)
from foo(x, y) in Main at REPL[10]:1
Arguments
#self#::Core.Const(foo)
x::Int64
y::Int64
Locals
#3::var"#3#4"
v::Union{Missing, Int64}
u::Any
z@_7::Core.Box
z@_8::Union{}
z@_9::Union{}
z@_10::Union{}
Body::Any1 ── Core.NewvarNode(:(#3))
│ Core.NewvarNode(:(v))
│ Core.NewvarNode(:(u))
│ (z@_7= Core.Box())
│ %5= (x + y)::Int64
└─── Core.setfield!(z@_7, :contents, %5)
2 ┄─ %7= Core.isdefined(z@_7, :contents)::Bool
└─── goto #4 if not %73 ── goto #54 ── Core.NewvarNode(:(z@_8))
└─── z@_85 ┄─ %12= Core.getfield(z@_7, :contents)::Any
│ %13= (%12<4)::Any
└─── goto #10 if not %136 ── %15= Core.isdefined(z@_7, :contents)::Bool
└─── goto #8 if not %157 ── goto #98 ── Core.NewvarNode(:(z@_9))
└─── z@_99 ┄─ %20= Core.getfield(z@_7, :contents)::Any
│ %21= (%20+1)::Any
│ Core.setfield!(z@_7, :contents, %21)
└─── goto #210 ─ (#3 = %new(Main.:(var"#3#4"), z@_7))
│ %25=#3::var"#3#4"
│ (u = (%25)(x))
│ %27= Core.apply_type(Main.Union, Main.Int, Main.Missing)::Core.Const(Union{Missing, Int64})
│ %28= Core.apply_type(Main.Ref, %27)::Core.Const(Ref{Union{Missing, Int64}})
│ %29= (%28)(x)::Base.RefValue{Union{Missing, Int64}}
│ %30= Base.getindex(%29)::Union{Missing, Int64}
│ (v =%30+ y)
│ %32= Core.isdefined(z@_7, :contents)::Bool
└─── goto #12 if not %3211 ─ goto #1312 ─ Core.NewvarNode(:(z@_10))
└─── z@_1013 ┄ %37= Core.getfield(z@_7, :contents)::Any
│ %38= (%37*7)::Any
└─── return%38
The text was updated successfully, but these errors were encountered:
Ah, I didn't realize these slots are in the lowered code already. In that case, maybe the better question is why lowering emitted these unused slots in the first place.
Is it intentional that we display the unused slots
z@_8
,z@_9
andz@_10
and their NewvarNodes here? Or should that have been cleaned up before printing?The text was updated successfully, but these errors were encountered: