[Metal] sincos parameter attributes#762
Conversation
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/src/metal.jl b/src/metal.jl
index fd571f1..5142774 100644
--- a/src/metal.jl
+++ b/src/metal.jl
@@ -1013,7 +1013,7 @@ function annotate_air_intrinsics!(@nospecialize(job::CompilerJob), mod::LLVM.Mod
end
push!(fn_attrs, EnumAttribute(name, 0))
end
- changed = true
+ return changed = true
end
function add_param_attributes(idx, names...)
@@ -1028,7 +1028,7 @@ function annotate_air_intrinsics!(@nospecialize(job::CompilerJob), mod::LLVM.Mod
if fn == "air.wg.barrier" || fn == "air.simdgroup.barrier"
add_fn_attributes("nounwind", "mustprogress", "convergent", "willreturn")
- # sincos
+ # sincos
elseif match(r"^air.sincos", fn) !== nothing
add_param_attributes(2, "nocapture", "writeonly")
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #762 +/- ##
==========================================
+ Coverage 79.41% 79.46% +0.04%
==========================================
Files 25 25
Lines 4591 4601 +10
==========================================
+ Hits 3646 3656 +10
Misses 945 945 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Are we correctly emitting |
maleadt
left a comment
There was a problem hiding this comment.
LGTM, thanks.
It would be good to start adding tests for things like this though. Should be reasonable with the FileCheck infrastructure we have nowadays.
|
I agree that tests are probably a good idea. I'll look into FileCheck at some point in the near future. Merging can probably wait until I get around to tests (unless someone speaks up otherwise). |
- extend the regex to also match `air.fast_sincos.*`, which Metal.jl emits for `FastMath.sincos_fast` with the same signature - emit `captures(none)` instead of `nocapture` on LLVM 21+, matching the existing workarounds elsewhere - add a FileCheck test covering the annotated declarations Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Close #663. This does NOT resolve issue #761 but I wrote it while troubleshooting it and figured I may as well open a PR.