Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5843ac5
fix _apply_pure deprecation (#57800)
vtjnash Mar 17, 2025
665cf7c
precompile_utils: Don't auto-enqueue `macro` methods for pre-compilat…
topolarity Mar 26, 2025
383a8b8
`Compiler`: `abstract_eval_invoke_inst`: type assert `Expr` (#57860)
nsajko Mar 27, 2025
4ffd735
`Compiler`: `walk_to_defs`, `collect_leaves`: specialize for `predece…
nsajko Mar 27, 2025
a2460d3
only update fragmentation data for pages that are not lazily freed (#…
d-netto Mar 28, 2025
19abebf
`Random`: `show` method for `MersenneTwister`: invalidation resistanc…
nsajko Mar 28, 2025
5a7f1b5
Teach alloc-opt to handle atomics a bit better (#57208)
gbaraldi Mar 28, 2025
42e5e47
Refactor IOBuffer code (#57570)
jakobnissen Mar 28, 2025
efc1ba9
Move `eachregion(::AnnotatedString)` implementation to `Base` (#57912)
topolarity Mar 29, 2025
57b1cd5
`Base`: shell escaping: inference improvement to prevent invalidation…
nsajko Mar 30, 2025
4183b2c
Support adding `CodeInstance`s to JIT for interpreters defining a cod…
serenity4 Feb 17, 2025
bea6fd1
inference: add internal SOURCE_MODE_GET_SOURCE mode (#57878)
vtjnash Mar 28, 2025
f70dfcf
`_precompilepkgs`: interactive progress display: fix unintended captu…
nsajko Mar 31, 2025
594b17d
staticdata: Memoize `type_in_worklist` query (#57917)
topolarity Mar 31, 2025
318028a
fix opaque_closure sparam capture (#57928)
vtjnash Mar 31, 2025
7a9c684
inference: fix exct modeling of `setglobal!` (#57896)
aviatesk Mar 27, 2025
fceace7
fix trimming size regression due to handling binding backedges in the…
JeffBezanson Mar 31, 2025
189359e
Clarify disabling of tab-completion hinting in the documentation (#57…
thofma Feb 21, 2025
4bf5a26
change file size test for trimming
KristofferC Mar 31, 2025
a3b193c
add trimming of new usings_backedges and scanned_methods fields (#57879)
JeffBezanson Mar 26, 2025
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
6 changes: 4 additions & 2 deletions Compiler/extras/CompilerDevTools/src/CompilerDevTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ struct SplitCacheInterp <: Compiler.AbstractInterpreter
inf_params::Compiler.InferenceParams
opt_params::Compiler.OptimizationParams
inf_cache::Vector{Compiler.InferenceResult}
codegen_cache::IdDict{CodeInstance,CodeInfo}
function SplitCacheInterp(;
world::UInt = Base.get_world_counter(),
inf_params::Compiler.InferenceParams = Compiler.InferenceParams(),
opt_params::Compiler.OptimizationParams = Compiler.OptimizationParams(),
inf_cache::Vector{Compiler.InferenceResult} = Compiler.InferenceResult[])
new(world, inf_params, opt_params, inf_cache)
new(world, inf_params, opt_params, inf_cache, IdDict{CodeInstance,CodeInfo}())
end
end

Expand All @@ -23,10 +24,11 @@ Compiler.OptimizationParams(interp::SplitCacheInterp) = interp.opt_params
Compiler.get_inference_world(interp::SplitCacheInterp) = interp.world
Compiler.get_inference_cache(interp::SplitCacheInterp) = interp.inf_cache
Compiler.cache_owner(::SplitCacheInterp) = SplitCacheOwner()
Compiler.codegen_cache(interp::SplitCacheInterp) = interp.codegen_cache

import Core.OptimizedGenerics.CompilerPlugins: typeinf, typeinf_edge
@eval @noinline typeinf(::SplitCacheOwner, mi::MethodInstance, source_mode::UInt8) =
Base.invoke_in_world(which(typeinf, Tuple{SplitCacheOwner, MethodInstance, UInt8}).primary_world, Compiler.typeinf_ext, SplitCacheInterp(; world=Base.tls_world_age()), mi, source_mode)
Base.invoke_in_world(which(typeinf, Tuple{SplitCacheOwner, MethodInstance, UInt8}).primary_world, Compiler.typeinf_ext_toplevel, SplitCacheInterp(; world=Base.tls_world_age()), mi, source_mode)

@eval @noinline function typeinf_edge(::SplitCacheOwner, mi::MethodInstance, parent_frame::Compiler.InferenceState, world::UInt, source_mode::UInt8)
# TODO: This isn't quite right, we're just sketching things for now
Expand Down
7 changes: 3 additions & 4 deletions Compiler/src/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2561,7 +2561,6 @@ function abstract_eval_setglobalonce!(interp::AbstractInterpreter, sv::AbsIntSta
end
end


function abstract_eval_replaceglobal!(interp::AbstractInterpreter, sv::AbsIntState, saw_latestworld::Bool, argtypes::Vector{Any})
if length(argtypes) in (5, 6, 7)
(M, s, x, v) = argtypes[2], argtypes[3], argtypes[4], argtypes[5]
Expand Down Expand Up @@ -3624,7 +3623,7 @@ end

function global_assignment_rt_exct(interp::AbstractInterpreter, sv::AbsIntState, saw_latestworld::Bool, g::GlobalRef, @nospecialize(newty))
if saw_latestworld
return Pair{Any,Any}(newty, Union{ErrorException, TypeError})
return Pair{Any,Any}(newty, ErrorException)
end
(valid_worlds, ret) = scan_partitions((interp, _, partition)->global_assignment_binding_rt_exct(interp, partition, newty), interp, g, sv.world)
update_valid_age!(sv, valid_worlds)
Expand All @@ -3641,10 +3640,10 @@ function global_assignment_binding_rt_exct(interp::AbstractInterpreter, partitio
ty = kind == PARTITION_KIND_DECLARED ? Any : partition_restriction(partition)
wnewty = widenconst(newty)
if !hasintersect(wnewty, ty)
return Pair{Any,Any}(Bottom, TypeError)
return Pair{Any,Any}(Bottom, ErrorException)
elseif !(wnewty <: ty)
retty = tmeet(typeinf_lattice(interp), newty, ty)
return Pair{Any,Any}(retty, TypeError)
return Pair{Any,Any}(retty, ErrorException)
end
return Pair{Any,Any}(newty, Bottom)
end
Expand Down
9 changes: 1 addition & 8 deletions Compiler/src/bootstrap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,10 @@ function bootstrap!()
end
mi = specialize_method(m.method, Tuple{params...}, m.sparams)
#isa_compileable_sig(mi) || println(stderr, "WARNING: inferring `", mi, "` which isn't expected to be called.")
push!(methods, mi)
typeinf_ext_toplevel(mi, world, isa_compileable_sig(mi) ? SOURCE_MODE_ABI : SOURCE_MODE_NOT_REQUIRED)
end
end
end
codeinfos = typeinf_ext_toplevel(methods, [world], TRIM_NO)
for i = 1:2:length(codeinfos)
ci = codeinfos[i]::CodeInstance
src = codeinfos[i + 1]::CodeInfo
isa_compileable_sig(ci.def) || continue # println(stderr, "WARNING: compiling `", ci.def, "` which isn't expected to be called.")
ccall(:jl_add_codeinst_to_jit, Cvoid, (Any, Any), ci, src)
end
endtime = time()
println("Base.Compiler ──── ", sub_float(endtime,starttime), " seconds")
end
Expand Down
2 changes: 1 addition & 1 deletion Compiler/src/ssair/irinterp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function concrete_eval_invoke(interp::AbstractInterpreter, ci::CodeInstance, arg
end

function abstract_eval_invoke_inst(interp::AbstractInterpreter, inst::Instruction, irsv::IRInterpretationState)
stmt = inst[:stmt]
stmt = inst[:stmt]::Expr
ci = stmt.args[1]
if ci isa MethodInstance
world = frame_world(irsv)
Expand Down
4 changes: 2 additions & 2 deletions Compiler/src/ssair/passes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function find_def_for_use(
end

function collect_leaves(compact::IncrementalCompact, @nospecialize(val), @nospecialize(typeconstraint), 𝕃ₒ::AbstractLattice,
predecessors = ((@nospecialize(def), compact::IncrementalCompact) -> isa(def, PhiNode) ? def.values : nothing))
predecessors::Pre = ((@nospecialize(def), compact::IncrementalCompact) -> isa(def, PhiNode) ? def.values : nothing)) where {Pre}
if isa(val, Union{OldSSAValue, SSAValue})
val, typeconstraint = simple_walk_constraint(compact, val, typeconstraint)
end
Expand Down Expand Up @@ -271,7 +271,7 @@ Starting at `val` walk use-def chains to get all the leaves feeding into this `v
`predecessors(def, compact)` is a callback which should return the set of possible
predecessors for a "phi-like" node (PhiNode or Core.ifelse) or `nothing` otherwise.
"""
function walk_to_defs(compact::IncrementalCompact, @nospecialize(defssa), @nospecialize(typeconstraint), predecessors, 𝕃ₒ::AbstractLattice)
function walk_to_defs(compact::IncrementalCompact, @nospecialize(defssa), @nospecialize(typeconstraint), predecessors::Pre, 𝕃ₒ::AbstractLattice) where {Pre}
visited_philikes = AnySSAValue[]
isa(defssa, AnySSAValue) || return Any[defssa], visited_philikes
def = compact[defssa][:stmt]
Expand Down
Loading