Skip to content

Commit 03d1170

Browse files
authored
Fixes for 1.13 and 1.14 (#757)
* Restrict installation of incompatible LLVM_jll. * Fix use of removed WorldView. * Fix CodeInfo.edges type for Julia 1.14 * Use consistent_overlay during testing * Add 1.13 CI.
1 parent e2d8505 commit 03d1170

5 files changed

Lines changed: 24 additions & 8 deletions

File tree

.github/workflows/Test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
version: ['1.10', '1.11', '1.12', 'nightly']
22+
version: ['1.10', '1.11', '1.12', '1.13-nightly', 'nightly']
2323
os: [ubuntu-24.04, ubuntu-24.04-arm, macOS-15, macOS-15-intel, windows-2025]
2424
arch: [x64, arm64]
2525
llvm_args: ['']

src/jlgen.jl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function methodinstance_generator(world::UInt, source, self, ft::Type, tt::Type)
135135
# propagate edge metadata
136136
new_ci.min_world = min_world[]
137137
new_ci.max_world = max_world[]
138-
new_ci.edges = MethodInstance[mi]
138+
new_ci.edges = Any[mi]
139139

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

504504

505505
## world view of the cache
506-
using Core.Compiler: WorldView
506+
@static if VERSION < v"1.14-"
507+
using Core.Compiler: WorldView
508+
end
507509

508510
if !HAS_INTEGRATED_CACHE
509511

@@ -624,6 +626,16 @@ function ci_cache_populate(interp, cache, mi, min_world, max_world)
624626
return codeinfos
625627
end
626628

629+
@static if VERSION >= v"1.14-"
630+
function ci_cache_lookup(cache, mi, min_world, max_world)
631+
# In Julia 1.14+, WorldView was replaced by InternalCodeCache with WorldRange
632+
# cache is OverlayCodeCache{InternalCodeCache}, extract owner from globalcache
633+
owner = cache.globalcache.owner
634+
wvc = CC.InternalCodeCache(owner, CC.WorldRange(min_world, max_world))
635+
ci = CC.get(wvc, mi, nothing)
636+
return ci
637+
end
638+
else
627639
function ci_cache_lookup(cache, mi, min_world, max_world)
628640
wvc = WorldView(cache, min_world, max_world)
629641
ci = CC.get(wvc, mi, nothing)
@@ -635,6 +647,7 @@ function ci_cache_lookup(cache, mi, min_world, max_world)
635647
end
636648
return ci
637649
end
650+
end # @static if
638651

639652

640653
## interface

test/Project.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,4 @@ demumble_jll = "1e29f10c-031c-5a83-9565-69cddfc27673"
1818
[compat]
1919
Aqua = "0.8"
2020
ParallelTestRunner = "1"
21-
22-
[extras]
23-
GPUCompiler = "61eb1bfa-7361-4325-ad38-22787b887f55"
21+
LLVM_jll = "15,16,18,20"

test/helpers/enzyme.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function deferred_codegen_id_generator(world::UInt, source, self, ft::Type, tt::
9595
# new_ci.min_world = min_world[]
9696
new_ci.min_world = world
9797
new_ci.max_world = max_world[]
98-
new_ci.edges = Core.MethodInstance[mi]
98+
new_ci.edges = Any[mi]
9999

100100
# prepare the slots
101101
new_ci.slotnames = Symbol[Symbol("#self#"), :ft, :tt]

test/native.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,12 @@ end
643643
end
644644

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

649654
@test @filecheck begin

0 commit comments

Comments
 (0)