-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
compiler:inferenceType inferenceType inference
Description
Minimal example:
julia> function fact(x)
res = 1
while x > 1
res *= x
x -= 1
end
return res
end
fact (generic function with 1 method)
julia> code_typed() do
fact(1)
end
1-element Vector{Any}:
CodeInfo(
1 ─ return 1
) => Int64
julia> code_typed() do
fact(2)
end
1-element Vector{Any}:
CodeInfo(
1 ─ nothing::Nothing
2 ┄ %2 = φ (#1 => 1, #3 => %6)::Int64
│ %3 = φ (#1 => 2, #3 => %7)::Int64
│ %4 = Base.slt_int(1, %3)::Bool
└── goto #4 if not %4
3 ─ %6 = Base.mul_int(%2, %3)::Int64
│ %7 = Base.sub_int(%3, 1)::Int64
└── goto #2
4 ─ goto #5
5 ─ return %2
) => Int64Metadata
Metadata
Assignees
Labels
compiler:inferenceType inferenceType inference