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 Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "GPUCompiler"
uuid = "61eb1bfa-7361-4325-ad38-22787b887f55"
version = "1.22.1"
version = "1.22.2"
authors = ["Tim Besard <tim.besard@gmail.com>"]

[workspace]
Expand Down
8 changes: 7 additions & 1 deletion src/metal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,13 @@ function add_argument_metadata!(@nospecialize(job::CompilerJob), mod::LLVM.Modul
# XXX: unknown
push!(md, Metadata(ConstantInt(Int32(1))))

push!(md, MDString("air.read_write")) # TODO: Check for const array
# only pointer-to-data arguments are written through; by-reference values (kernel
# state, bitstype objects) are read into a stack slot and never written back.
if arg.cc == BITS_VALUE && (arg.typ <: Ptr || arg.typ <: Core.LLVMPtr)
push!(md, MDString("air.read_write"))
else
push!(md, MDString("air.read"))
end

push!(md, MDString("air.address_space"))
push!(md, Metadata(ConstantInt(Int32(addrspace(parameters(entry_ft)[arg.idx])))))
Expand Down