[clang] [llvm] [NVPTX] Support __usAtomicCAS builtin (PR #99646)

via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 19 11:17:13 PDT 2024


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 71801707e33c235656b172fa7dfb8662473a95c2 c18b58183b0b19fab98c9bcf0e5c7af7966cf2d4 --extensions h,c,cpp -- clang/lib/CodeGen/CGBuiltin.cpp clang/lib/Headers/__clang_cuda_device_functions.h clang/test/CodeGen/builtins-nvptx.c llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp llvm/lib/Target/NVPTX/NVPTXSubtarget.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Headers/__clang_cuda_device_functions.h b/clang/lib/Headers/__clang_cuda_device_functions.h
index f66fe625a3..86123727a1 100644
--- a/clang/lib/Headers/__clang_cuda_device_functions.h
+++ b/clang/lib/Headers/__clang_cuda_device_functions.h
@@ -529,15 +529,17 @@ __DEVICE__ void __threadfence(void) { __nvvm_membar_gl(); }
 __DEVICE__ void __threadfence_block(void) { __nvvm_membar_cta(); };
 __DEVICE__ void __threadfence_system(void) { __nvvm_membar_sys(); };
 __DEVICE__ void __trap(void) { __asm__ __volatile__("trap;"); }
-__DEVICE__ unsigned short __usAtomicCAS(unsigned short *__p, unsigned short __cmp,
-                                        unsigned short __v) {
+__DEVICE__ unsigned short
+__usAtomicCAS(unsigned short *__p, unsigned short __cmp, unsigned short __v) {
   return __nvvm_atom_cas_gen_us(__p, __cmp, __v);
 }
-__DEVICE__ unsigned short __usAtomicCAS_block(unsigned short *__p, unsigned short __cmp,
+__DEVICE__ unsigned short __usAtomicCAS_block(unsigned short *__p,
+                                              unsigned short __cmp,
                                               unsigned short __v) {
   return __nvvm_atom_cta_cas_gen_us(__p, __cmp, __v);
 }
-__DEVICE__ unsigned short __usAtomicCAS_system(unsigned short *__p, unsigned short __cmp,
+__DEVICE__ unsigned short __usAtomicCAS_system(unsigned short *__p,
+                                               unsigned short __cmp,
                                                unsigned short __v) {
   return __nvvm_atom_sys_cas_gen_us(__p, __cmp, __v);
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/99646


More information about the cfe-commits mailing list