Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to LLVM.jl 6. #213

Merged
merged 1 commit into from
Jun 23, 2023
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
18 changes: 9 additions & 9 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.8.5"
manifest_format = "2.0"
project_hash = "d0c98adf98dfdf3c64a8e406df0976fb1c7d62f6"
project_hash = "617954e964a5116afabc8ebf962a6c16f3c378fa"

[[deps.Adapt]]
deps = ["LinearAlgebra", "Requires"]
Expand Down Expand Up @@ -67,9 +67,9 @@ uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"

[[deps.GPUArrays]]
deps = ["Adapt", "GPUArraysCore", "LLVM", "LinearAlgebra", "Printf", "Random", "Reexport", "Serialization", "Statistics"]
git-tree-sha1 = "a3351bc577a6b49297248aadc23a4add1097c2ac"
git-tree-sha1 = "2e57b4a4f9cc15e85a24d603256fe08e527f48d1"
uuid = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
version = "8.7.1"
version = "8.8.1"

[[deps.GPUArraysCore]]
deps = ["Adapt"]
Expand All @@ -79,9 +79,9 @@ version = "0.1.5"

[[deps.GPUCompiler]]
deps = ["ExprTools", "InteractiveUtils", "LLVM", "Libdl", "Logging", "Scratch", "TimerOutputs", "UUIDs"]
git-tree-sha1 = "c47730aca2381f935a52fd732190e424c507230e"
git-tree-sha1 = "69a9aa4346bca723e46769ff6b6277e597c969b1"
uuid = "61eb1bfa-7361-4325-ad38-22787b887f55"
version = "0.21.0"
version = "0.21.2"

[[deps.InteractiveUtils]]
deps = ["Markdown"]
Expand All @@ -101,9 +101,9 @@ version = "0.9.6"

[[deps.LLVM]]
deps = ["CEnum", "LLVMExtra_jll", "Libdl", "Printf", "Unicode"]
git-tree-sha1 = "5007c1421563108110bbd57f63d8ad4565808818"
git-tree-sha1 = "7d5788011dd273788146d40eb5b1fbdc199d0296"
uuid = "929cbde3-209d-540e-8aea-75f648917ca0"
version = "5.2.0"
version = "6.0.1"

[[deps.LLVMExtra_jll]]
deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"]
Expand Down Expand Up @@ -335,9 +335,9 @@ version = "0.2.1"

[[deps.UnsafeAtomicsLLVM]]
deps = ["LLVM", "UnsafeAtomics"]
git-tree-sha1 = "ea37e6066bf194ab78f4e747f5245261f17a7175"
git-tree-sha1 = "323e3d0acf5e78a56dfae7bd8928c989b4f3083e"
uuid = "d80eeb9a-aca5-4d75-85e5-170c8b632249"
version = "0.1.2"
version = "0.1.3"

[[deps.XZ_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ExprTools = "0.1"
GPUArrays = "8.4"
GPUCompiler = "0.20, 0.21"
KernelAbstractions = "0.9.1"
LLVM = "5"
LLVM = "6"
Metal_LLVM_Tools_jll = "~0.5"
ObjectFile = "0.4"
ObjectiveC = "0.1"
Expand Down
7 changes: 2 additions & 5 deletions src/compiler/compilation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@ end
# compile to executable machine code
function compile(@nospecialize(job::CompilerJob))
# TODO: on 1.9, this actually creates a context. cache those.
JuliaContext() do ctx
compile(job, ctx)
image, meta = JuliaContext() do ctx
GPUCompiler.compile(:obj, job)
end
end
function compile(@nospecialize(job::CompilerJob), ctx)
image, meta = GPUCompiler.compile(:obj, job; ctx)
entry = LLVM.name(meta.entry)

return (; image, entry)
Expand Down
10 changes: 5 additions & 5 deletions src/device/intrinsics/memory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ end
# get a pointer to threadgroup memory, with known (static) or zero length (dynamic)
@generated function emit_threadgroup_memory(::Type{T}, ::Val{len}=Val(0)) where {T,len}
Context() do ctx
eltyp = convert(LLVMType, T; ctx)
T_ptr = convert(LLVMType, Core.LLVMPtr{T,AS.ThreadGroup}; ctx)
eltyp = convert(LLVMType, T)
T_ptr = convert(LLVMType, Core.LLVMPtr{T,AS.ThreadGroup})

# create a function
llvm_f, _ = create_function(T_ptr)
Expand All @@ -53,11 +53,11 @@ end
alignment!(gv, 16) # source: Metal Feature Set Tables

# generate IR
IRBuilder(ctx) do builder
entry = BasicBlock(llvm_f, "entry"; ctx)
IRBuilder() do builder
entry = BasicBlock(llvm_f, "entry")
position!(builder, entry)

ptr = gep!(builder, gv_typ, gv, [ConstantInt(0; ctx), ConstantInt(0; ctx)])
ptr = gep!(builder, gv_typ, gv, [ConstantInt(0), ConstantInt(0)])

untyped_ptr = bitcast!(builder, ptr, T_ptr)

Expand Down