Skip to content

Commit 7143d02

Browse files
authored
Bump minimal Julia requirement to v1.10. (#598)
1 parent 85316c7 commit 7143d02

File tree

15 files changed

+98
-336
lines changed

15 files changed

+98
-336
lines changed

.buildkite/pipeline.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ steps:
22
- label: "CUDA.jl"
33
plugins:
44
- JuliaCI/julia#v1:
5-
version: 1.8
5+
version: "1.10"
66
- JuliaCI/julia-coverage#v1:
77
codecov: true
88
command: |
@@ -25,7 +25,7 @@ steps:
2525
- label: "oneAPI.jl"
2626
plugins:
2727
- JuliaCI/julia#v1:
28-
version: 1.8
28+
version: "1.10"
2929
- JuliaCI/julia-coverage#v1:
3030
codecov: true
3131
command: |
@@ -52,7 +52,7 @@ steps:
5252
- label: "Metal.jl"
5353
plugins:
5454
- JuliaCI/julia#v1:
55-
version: 1.8
55+
version: "1.10"
5656
- JuliaCI/julia-coverage#v1:
5757
codecov: true
5858
command: |
@@ -73,33 +73,33 @@ steps:
7373
soft_fail:
7474
- exit_status: 3
7575

76-
# - label: "AMDGPU.jl"
77-
# plugins:
78-
# - JuliaCI/julia#v1:
79-
# version: 1.8
80-
# - JuliaCI/julia-coverage#v1:
81-
# codecov: true
82-
# command: |
83-
# julia -e 'println("--- :julia: Instantiating project")
84-
# using Pkg
85-
# Pkg.develop(; path=pwd())
86-
# Pkg.develop(; name="AMDGPU")' || exit 3
87-
#
88-
# julia -e 'println("+++ :julia: Running tests")
89-
# using Pkg
90-
# Pkg.test("AMDGPU"; coverage=true)'
91-
# agents:
92-
# queue: "juliagpu"
93-
# rocm: "*"
94-
# if: build.message !~ /\[skip tests\]/ && !build.pull_request.draft
95-
# timeout_in_minutes: 120
96-
# soft_fail:
97-
# - exit_status: 3
76+
# - label: "AMDGPU.jl"
77+
# plugins:
78+
# - JuliaCI/julia#v1:
79+
# version: "1.10"
80+
# - JuliaCI/julia-coverage#v1:
81+
# codecov: true
82+
# command: |
83+
# julia -e 'println("--- :julia: Instantiating project")
84+
# using Pkg
85+
# Pkg.develop(; path=pwd())
86+
# Pkg.develop(; name="AMDGPU")' || exit 3
87+
88+
# julia -e 'println("+++ :julia: Running tests")
89+
# using Pkg
90+
# Pkg.test("AMDGPU"; coverage=true)'
91+
# agents:
92+
# queue: "juliagpu"
93+
# rocm: "*"
94+
# if: build.message !~ /\[skip tests\]/ && !build.pull_request.draft
95+
# timeout_in_minutes: 120
96+
# soft_fail:
97+
# - exit_status: 3
9898

9999
- label: "Enzyme.jl"
100100
plugins:
101101
- JuliaCI/julia#v1:
102-
version: 1.8
102+
version: "1.10"
103103
- JuliaCI/julia-coverage#v1:
104104
codecov: true
105105
command: |

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
version: ['1.8', '1.9', '1.10', 'pre'] # 'nightly'
21+
version: ['1.10', 'pre'] # 'nightly'
2222
os: [ubuntu-latest, macOS-latest, windows-latest]
2323
arch: [x64]
2424
llvm_args: ['']

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ Scratch = "1"
2828
Serialization = "1"
2929
TOML = "1"
3030
TimerOutputs = "0.5"
31-
julia = "1.8"
31+
julia = "1.10"

src/GPUCompiler.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ _precompile_()
5353

5454

5555
compile_cache = "" # defined in __init__()
56-
const pkgver = @static VERSION > v"1.9" ? Base.pkgversion(GPUCompiler) : nothing
56+
const pkgver = Base.pkgversion(GPUCompiler)
5757

5858
function __init__()
5959
STDERR_HAS_COLOR[] = get(stderr, :color, false)

src/driver.jl

Lines changed: 14 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -19,52 +19,22 @@ export JuliaContext
1919
# unique context on all other versions. Once we only support Julia 1.9, we'll deprecate
2020
# this helper to a regular `Context()` call.
2121
function JuliaContext(; opaque_pointers=nothing)
22-
if VERSION >= v"1.9.0-DEV.516"
23-
# Julia 1.9 knows how to deal with arbitrary contexts,
24-
# and uses ORC's thread safe versions.
25-
ctx = ThreadSafeContext(; opaque_pointers)
26-
elseif VERSION >= v"1.9.0-DEV.115"
27-
# Julia 1.9 knows how to deal with arbitrary contexts
28-
ctx = Context(; opaque_pointers)
29-
else
30-
# earlier versions of Julia claim so, but actually use a global context
31-
isboxed_ref = Ref{Bool}()
32-
typ = LLVMType(ccall(:jl_type_to_llvm, LLVM.API.LLVMTypeRef,
33-
(Any, Ptr{Bool}), Any, isboxed_ref))
34-
ctx = context(typ)
35-
if opaque_pointers !== nothing && supports_typed_pointers(ctx) !== !opaque_pointers
36-
error("Cannot use $(opaque_pointers ? "opaque" : "typed") pointers, as the context has already been configured to use $(supports_typed_pointers(ctx) ? "typed" : "opaque") pointers, and this version of Julia does not support changing that.")
37-
end
38-
end
39-
40-
ctx
22+
# XXX: remove
23+
ThreadSafeContext(; opaque_pointers)
4124
end
4225
function JuliaContext(f; kwargs...)
43-
if VERSION >= v"1.9.0-DEV.516"
44-
ts_ctx = JuliaContext(; kwargs...)
45-
# for now, also activate the underlying context
46-
# XXX: this is wrong; we can't expose the underlying LLVM context, but should
47-
# instead always go through the callback in order to unlock it properly.
48-
# rework this once we depend on Julia 1.9 or later.
49-
ctx = context(ts_ctx)
50-
activate(ctx)
51-
try
52-
f(ctx)
53-
finally
54-
deactivate(ctx)
55-
dispose(ts_ctx)
56-
end
57-
elseif VERSION >= v"1.9.0-DEV.115"
58-
Context(f)
59-
else
60-
ctx = JuliaContext()
61-
activate(ctx)
62-
try
63-
f(ctx)
64-
finally
65-
deactivate(ctx)
66-
# we cannot dispose of the global unique context
67-
end
26+
ts_ctx = JuliaContext(; kwargs...)
27+
# for now, also activate the underlying context
28+
# XXX: this is wrong; we can't expose the underlying LLVM context, but should
29+
# instead always go through the callback in order to unlock it properly.
30+
# rework this once we depend on Julia 1.9 or later.
31+
ctx = context(ts_ctx)
32+
activate(ctx)
33+
try
34+
f(ctx)
35+
finally
36+
deactivate(ctx)
37+
dispose(ts_ctx)
6838
end
6939
end
7040

@@ -118,9 +88,6 @@ function codegen(output::Symbol, @nospecialize(job::CompilerJob);
11888
only_entry::Bool=false, parent_job::Union{Nothing, CompilerJob}=nothing)
11989
if context(; throw_error=false) === nothing
12090
error("No active LLVM context. Use `JuliaContext()` do-block syntax to create one.")
121-
elseif VERSION < v"1.9.0-DEV.115" && context() != JuliaContext()
122-
error("""Julia <1.9 does not suppport generating code in an arbitrary LLVM context.
123-
Use `JuliaContext()` do-block syntax to get an appropriate one.""")
12491
end
12592

12693
@timeit_debug to "Validation" begin

src/gcn.jl

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -50,43 +50,6 @@ function finish_module!(@nospecialize(job::CompilerJob{GCNCompilerTarget}),
5050
return entry
5151
end
5252

53-
function optimize!(job::CompilerJob{GCNCompilerTarget}, mod::LLVM.Module)
54-
@static if VERSION < v"1.9.0-DEV.1018"
55-
# we have to fake our target early in the pipeline because Julia's
56-
# optimization passes weren't designed for a non-0 stack addrspace, and the
57-
# AMDGPU target is very strict about which addrspaces are permitted for
58-
# various code patterns
59-
triple!(mod, llvm_triple(NativeCompilerTarget()))
60-
datalayout!(mod, julia_datalayout(NativeCompilerTarget()))
61-
end
62-
63-
invoke(optimize!, Tuple{CompilerJob, LLVM.Module}, job, mod)
64-
end
65-
66-
# We need to do alloca rewriting (from 0 to 5) after Julia's optimization
67-
# passes because of two reasons:
68-
# 1. Debug builds call the target verifier first, which would trip if AMDGPU
69-
# was the target at that time
70-
# 2. We don't want any chance of messing with Julia's optimizations, since they
71-
# eliminate target-unsafe IR patterns
72-
function optimize_module!(job::CompilerJob{GCNCompilerTarget}, mod::LLVM.Module)
73-
@static if VERSION < v"1.9.0-DEV.1018"
74-
# revert back to the AMDGPU target
75-
triple!(mod, llvm_triple(job.config.target))
76-
datalayout!(mod, julia_datalayout(job.config.target))
77-
78-
tm = llvm_machine(job.config.target)
79-
@dispose pm=ModulePassManager() begin
80-
add_library_info!(pm, triple(mod))
81-
add_transform_info!(pm, tm)
82-
83-
add!(pm, FunctionPass("FixAllocaAddrspace", fix_alloca_addrspace!))
84-
85-
run!(pm, mod)
86-
end
87-
end
88-
end
89-
9053

9154
## LLVM passes
9255

src/irgen.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function irgen(@nospecialize(job::CompilerJob))
1313
# clean up incompatibilities
1414
@timeit_debug to "clean-up" begin
1515
for llvmf in functions(mod)
16-
if VERSION < v"1.9" || Base.isdebugbuild()
16+
if Base.isdebugbuild()
1717
# only occurs in debug builds
1818
delete!(function_attributes(llvmf),
1919
EnumAttribute("sspstrong", 0))

0 commit comments

Comments
 (0)