-
-
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 ksh/mini_annot
- Loading branch information
Showing
388 changed files
with
7,192 additions
and
59,839 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,26 @@ | ||
MIT License | ||
|
||
Copyright (c) 2009-2024: Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors: https://github.com/JuliaLang/julia/contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
end of terms and conditions | ||
|
||
Please see [THIRDPARTY.md](../THIRDPARTY.md) for license information for other software used in this project. |
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 |
---|---|---|
@@ -1,3 +1,15 @@ | ||
name = "Compiler" | ||
uuid = "807dbc54-b67e-4c79-8afb-eafe4df6f2e1" | ||
version = "0.0.1" | ||
version = "0.0.2" | ||
|
||
[compat] | ||
julia = "1.10" | ||
|
||
[extras] | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" | ||
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | ||
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" | ||
|
||
[targets] | ||
test = ["Test", "InteractiveUtils", "Random", "Libdl"] |
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
Oops, something went wrong.