Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inference: refactoring to allow irinterp to perform :call inference #48913

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
387 changes: 207 additions & 180 deletions base/compiler/abstractinterpretation.jl

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion base/compiler/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ include("compiler/ssair/domtree.jl")
include("compiler/ssair/ir.jl")

include("compiler/abstractlattice.jl")

include("compiler/inferenceresult.jl")
include("compiler/inferencestate.jl")

Expand Down
8 changes: 3 additions & 5 deletions base/compiler/inferenceresult.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function va_process_argtypes(@nospecialize(va_handler!), 𝕃::AbstractLattice,
nargs = Int(def.nargs)
if isva || isvarargtype(given_argtypes[end])
isva_given_argtypes = Vector{Any}(undef, nargs)
for i = 1:(nargs - isva)
for i = 1:(nargs-isva)
isva_given_argtypes[i] = argtype_by_index(given_argtypes, i)
end
if isva
Expand All @@ -110,10 +110,8 @@ function most_general_argtypes(method::Union{Method, Nothing}, @nospecialize(spe
isva = !toplevel && method.isva
linfo_argtypes = Any[(unwrap_unionall(specTypes)::DataType).parameters...]
nargs::Int = toplevel ? 0 : method.nargs
if !withfirst
# For opaque closure, the closure environment is processed elsewhere
nargs -= 1
end
# For opaque closure, the closure environment is processed elsewhere
withfirst || (nargs -= 1)
cache_argtypes = Vector{Any}(undef, nargs)
# First, if we're dealing with a varargs method, then we set the last element of `args`
# to the appropriate `Tuple` type or `PartialStruct` instance.
Expand Down
Loading