Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: ['1.10', '1.11', '1.12', 'nightly']
version: ['1.10', '1.11', '1.12', '1.13-nightly', 'nightly']
os: [ubuntu-24.04, ubuntu-24.04-arm, macOS-15, macOS-15-intel, windows-2025]
arch: [x64, arm64]
llvm_args: ['']
Expand Down
17 changes: 15 additions & 2 deletions src/jlgen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function methodinstance_generator(world::UInt, source, self, ft::Type, tt::Type)
# propagate edge metadata
new_ci.min_world = min_world[]
new_ci.max_world = max_world[]
new_ci.edges = MethodInstance[mi]
new_ci.edges = Any[mi]

# prepare the slots
new_ci.slotnames = Symbol[Symbol("#self#"), :ft, :tt]
Expand Down Expand Up @@ -503,7 +503,9 @@ CC.method_table(interp::GPUInterpreter) = interp.method_table_view


## world view of the cache
using Core.Compiler: WorldView
@static if VERSION < v"1.14-"
using Core.Compiler: WorldView
end

if !HAS_INTEGRATED_CACHE

Expand Down Expand Up @@ -624,6 +626,16 @@ function ci_cache_populate(interp, cache, mi, min_world, max_world)
return codeinfos
end

@static if VERSION >= v"1.14-"
function ci_cache_lookup(cache, mi, min_world, max_world)
# In Julia 1.14+, WorldView was replaced by InternalCodeCache with WorldRange
# cache is OverlayCodeCache{InternalCodeCache}, extract owner from globalcache
owner = cache.globalcache.owner
wvc = CC.InternalCodeCache(owner, CC.WorldRange(min_world, max_world))
ci = CC.get(wvc, mi, nothing)
return ci
end
else
function ci_cache_lookup(cache, mi, min_world, max_world)
wvc = WorldView(cache, min_world, max_world)
ci = CC.get(wvc, mi, nothing)
Expand All @@ -635,6 +647,7 @@ function ci_cache_lookup(cache, mi, min_world, max_world)
end
return ci
end
end # @static if


## interface
Expand Down
4 changes: 1 addition & 3 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@ demumble_jll = "1e29f10c-031c-5a83-9565-69cddfc27673"
[compat]
Aqua = "0.8"
ParallelTestRunner = "1"

[extras]
GPUCompiler = "61eb1bfa-7361-4325-ad38-22787b887f55"
LLVM_jll = "15,16,18,20"
2 changes: 1 addition & 1 deletion test/helpers/enzyme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function deferred_codegen_id_generator(world::UInt, source, self, ft::Type, tt::
# new_ci.min_world = min_world[]
new_ci.min_world = world
new_ci.max_world = max_world[]
new_ci.edges = Core.MethodInstance[mi]
new_ci.edges = Any[mi]

# prepare the slots
new_ci.slotnames = Symbol[Symbol("#self#"), :ft, :tt]
Expand Down
7 changes: 6 additions & 1 deletion test/native.jl
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,12 @@ end
end

Base.Experimental.@MethodTable method_table
Base.Experimental.@overlay method_table @noinline Core.throw_inexacterror(f::Symbol, ::Type{T}, val) where {T} = return
# @consistent_overlay (Julia 1.11+) is needed for the compiler to optimize through the overlay
@static if VERSION >= v"1.11-"
Base.Experimental.@consistent_overlay method_table @noinline Core.throw_inexacterror(f::Symbol, ::Type{T}, val) where {T} = return
else
Base.Experimental.@overlay method_table @noinline Core.throw_inexacterror(f::Symbol, ::Type{T}, val) where {T} = return
end
end

@test @filecheck begin
Expand Down