[libc] [llvm] [libc] Make GPU `_end` kernel only call exit callbacks (PR #162371)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 7 13:54:35 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- libc/startup/gpu/amdgpu/start.cpp libc/startup/gpu/nvptx/start.cpp llvm/tools/llvm-gpu-loader/amdhsa.cpp llvm/tools/llvm-gpu-loader/llvm-gpu-loader.h llvm/tools/llvm-gpu-loader/nvptx.cpp
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libc/startup/gpu/nvptx/start.cpp b/libc/startup/gpu/nvptx/start.cpp
index f6e0c849b..3dd85fdf3 100644
--- a/libc/startup/gpu/nvptx/start.cpp
+++ b/libc/startup/gpu/nvptx/start.cpp
@@ -71,8 +71,7 @@ _start(int argc, char **argv, char **envp, int *ret) {
__atomic_fetch_or(ret, main(argc, argv, envp), __ATOMIC_RELAXED);
}
-extern "C" [[gnu::visibility("protected"), clang::nvptx_kernel]] void
-_end() {
+extern "C" [[gnu::visibility("protected"), clang::nvptx_kernel]] void _end() {
// Only a single thread should call the destructors registred with 'atexit'.
// The loader utility will handle the actual exit and return code cleanly.
__cxa_finalize(nullptr);
``````````
</details>
https://github.com/llvm/llvm-project/pull/162371
More information about the llvm-commits
mailing list