diff options
| author | Nick Sarnie <nick.sarnie@intel.com> | 2025-10-22 23:47:29 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-22 14:47:29 +0000 |
| commit | f6ba21389fb0daad19bbb36a60cbfb4e7ef4efa2 (patch) | |
| tree | 9f51b6d4d0cfacf4c40ad31f7467bc3d7f252d51 /clang/docs/ReleaseNotes.rst | |
| parent | 65850de74d7fb52044e68bd79cc55e7fa1edcf0d (diff) | |
[clang] Fix inconsistencies with the device_kernel attr on different targets (#161905)
The original [change](https://github.com/llvm/llvm-project/pull/137882)
unifying the device kernel attributes had some inexplicable behavior,
such as `amdgpu_kernel` resulting in a function ending up with the
`spir_kernel` CC but `nvptx_kernel` not doing the same, both cases
compiling for SPIR. There was also a
[crash](https://github.com/llvm/llvm-project/issues/161077).
`sycl_kernel` is now separated out from `device_kernel`, but still there
was some weird behavior for the remaining spellings.
For the target-specific spellings (`nvptx_kernel` and `amdgpu_kernel`),
while not technically required, we warn and ignore the attribute if the
spelling doesn't match the target because it's weird from the user's
point of view to allow it.
Also we make sure that any valid usage actually applies the CC to the
generated `llvm:Function`. This worked for `NVPTX` already but was
missing for `SPIR/SPIR-V` and `AMDGPU`, it needs to be explicitly done
in `TargetInfo`. This allows us to remove the `amdgpu_kernel` specific
handing we had. That special handling was previously required because it
was the only variation that was allowed on a type, and thus had a
separate way to propagate the CC.
These issues were reported
[here](https://github.com/llvm/llvm-project/issues/161077) and
[here](https://github.com/llvm/llvm-project/pull/161349).
Closes: https://github.com/llvm/llvm-project/issues/161077
---------
Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
Diffstat (limited to 'clang/docs/ReleaseNotes.rst')
| -rw-r--r-- | clang/docs/ReleaseNotes.rst | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index fe77f917bb80..e6e33e7a9a28 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -447,6 +447,7 @@ Bug Fixes to Attribute Support - Using ``[[gnu::cleanup(some_func)]]`` where some_func is annotated with ``[[gnu::error("some error")]]`` now correctly triggers an error. (#GH146520) - Fix a crash when the function name is empty in the `swift_name` attribute. (#GH157075) +- Fixes crashes or missing diagnostics with the `device_kernel` attribute. (#GH161905) Bug Fixes to C++ Support ^^^^^^^^^^^^^^^^^^^^^^^^ |
