Cthulhu.jl icon indicating copy to clipboard operation
Cthulhu.jl copied to clipboard

show corresponding return types for each union-split callsite

Open aviatesk opened this issue 4 years ago • 0 comments

Can be described with the following example:

julia> f(::Int) = rand(Int)
f (generic function with 1 method)

julia> f(::Float64) = rand(Float64)
f (generic function with 2 methods)

julia> descend((Union{Int,Float64},); optimize = false) do t
           f(a)
       end
 ...
 • %1  = call #f(::Any)::Union{Float64, Int64}
   ↩
 • %1  = f(::Int64)::Union{Float64, Int64}   # <= ::Int64, ideally
   %1  = f(::Float64)::Union{Float64, Int64} # <= ::Float64, ideally
   ↩

We will need to obtain "not-merged" return types for each callsite somehow, and it requires additional or customized abstract interpretation passes under the current AbstractInterpreter inteface, I guess.

aviatesk avatar Mar 14 '21 09:03 aviatesk