Skip to content

Commit 45a6049

Browse files
committed
wip: inference: allow semi-concrete interpret to perform recursive inference
TODOs that should be addressed before merging: - [x] implement a simple recursion detection mechanism for `IRInterpretationState` - [x] add proper invalidation support - [x] allow constant inference from semi-concrete interpretation - [x] propagate callinfo and allow double inlining fix #48679 wip
1 parent bcfa77d commit 45a6049

File tree

13 files changed

+741
-568
lines changed

13 files changed

+741
-568
lines changed

base/compiler/abstractinterpretation.jl

Lines changed: 177 additions & 171 deletions
Large diffs are not rendered by default.

base/compiler/compiler.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ include("compiler/ssair/domtree.jl")
152152
include("compiler/ssair/ir.jl")
153153

154154
include("compiler/abstractlattice.jl")
155-
156155
include("compiler/inferenceresult.jl")
157156
include("compiler/inferencestate.jl")
158157

base/compiler/inferenceresult.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function va_process_argtypes(@nospecialize(va_handler!), 𝕃::AbstractLattice,
8686
nargs = Int(def.nargs)
8787
if isva || isvarargtype(given_argtypes[end])
8888
isva_given_argtypes = Vector{Any}(undef, nargs)
89-
for i = 1:(nargs - isva)
89+
for i = 1:(nargs-isva)
9090
isva_given_argtypes[i] = argtype_by_index(given_argtypes, i)
9191
end
9292
if isva
@@ -110,10 +110,8 @@ function most_general_argtypes(method::Union{Method, Nothing}, @nospecialize(spe
110110
isva = !toplevel && method.isva
111111
linfo_argtypes = Any[(unwrap_unionall(specTypes)::DataType).parameters...]
112112
nargs::Int = toplevel ? 0 : method.nargs
113-
if !withfirst
114-
# For opaque closure, the closure environment is processed elsewhere
115-
nargs -= 1
116-
end
113+
# For opaque closure, the closure environment is processed elsewhere
114+
!withfirst && (nargs -= 1)
117115
cache_argtypes = Vector{Any}(undef, nargs)
118116
# First, if we're dealing with a varargs method, then we set the last element of `args`
119117
# to the appropriate `Tuple` type or `PartialStruct` instance.

0 commit comments

Comments
 (0)