Skip to content

Commit c54b78e

Browse files
committed
Add some simdgroup and barrier intrinsic attributes
1 parent e4a697f commit c54b78e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/metal.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ function annotate_air_intrinsics!(@nospecialize(job::CompilerJob), mod::LLVM.Mod
10181018

10191019
# synchronization
10201020
if fn == "air.wg.barrier" || fn == "air.simdgroup.barrier"
1021-
add_attributes("nounwind", "convergent")
1021+
add_attributes("nounwind", "mustprogress", "convergent", "willreturn")
10221022

10231023
# atomics
10241024
elseif match(r"air.atomic.(local|global).load", fn) !== nothing
@@ -1033,6 +1033,14 @@ function annotate_air_intrinsics!(@nospecialize(job::CompilerJob), mod::LLVM.Mod
10331033
elseif match(r"^air.atomic.(local|global).(add|sub|min|max|and|or|xor)", fn) !== nothing
10341034
# TODO: "memory(argmem: readwrite)" on LLVM 16+
10351035
add_attributes("argmemonly", "nounwind")
1036+
1037+
# simdgroup
1038+
elseif match(r"air.simdgroup_matrix_8x8_multiply_accumulate", fn) !== nothing
1039+
add_attributes("convergent", "mustprogress", "nounwind", "willreturn")
1040+
elseif match(r"air.simdgroup_matrix_8x8_load", fn) !== nothing
1041+
add_attributes("convergent", "mustprogress", "nofree", "nounwind", "readonly", "willreturn")
1042+
elseif match(r"air.simdgroup_matrix_8x8_store", fn) !== nothing
1043+
add_attributes("convergent", "mustprogress", "nounwind", "willreturn", "writeonly")
10361044
end
10371045
end
10381046

0 commit comments

Comments
 (0)