-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into readeach_type_stability
- Loading branch information
Showing
233 changed files
with
3,608 additions
and
3,515 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This file is machine-generated - editing it directly is not advised | ||
|
||
julia_version = "1.12.0-DEV" | ||
manifest_format = "2.0" | ||
project_hash = "84f495a1bf065c95f732a48af36dd0cd2cefb9d5" | ||
|
||
[[deps.Compiler]] | ||
path = "../.." | ||
uuid = "807dbc54-b67e-4c79-8afb-eafe4df6f2e1" | ||
version = "0.0.2" | ||
|
||
[[deps.CompilerDevTools]] | ||
path = "." | ||
uuid = "92b2d91f-d2bd-4c05-9214-4609ac33433f" | ||
version = "0.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name = "CompilerDevTools" | ||
uuid = "92b2d91f-d2bd-4c05-9214-4609ac33433f" | ||
|
||
[deps] | ||
Compiler = "807dbc54-b67e-4c79-8afb-eafe4df6f2e1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
module CompilerDevTools | ||
|
||
using Compiler | ||
using Core.IR | ||
|
||
struct SplitCacheOwner; end | ||
struct SplitCacheInterp <: Compiler.AbstractInterpreter | ||
world::UInt | ||
inf_params::Compiler.InferenceParams | ||
opt_params::Compiler.OptimizationParams | ||
inf_cache::Vector{Compiler.InferenceResult} | ||
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) | ||
end | ||
end | ||
|
||
Compiler.InferenceParams(interp::SplitCacheInterp) = interp.inf_params | ||
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() | ||
|
||
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) | ||
|
||
@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 | ||
interp = SplitCacheInterp(; world) | ||
Compiler.typeinf_edge(interp, mi.def, mi.specTypes, Core.svec(), parent_frame, false, false) | ||
end | ||
|
||
function with_new_compiler(f, args...) | ||
mi = @ccall jl_method_lookup(Any[f, args...]::Ptr{Any}, (1+length(args))::Csize_t, Base.tls_world_age()::Csize_t)::Ref{Core.MethodInstance} | ||
world = Base.tls_world_age() | ||
new_compiler_ci = Core.OptimizedGenerics.CompilerPlugins.typeinf( | ||
SplitCacheOwner(), mi, Compiler.SOURCE_MODE_ABI | ||
) | ||
invoke(f, new_compiler_ci, args...) | ||
end | ||
|
||
export with_new_compiler | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.