[llvm] AMDGPU: Refactor atomicrmw fadd expansion logic (PR #89469)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 19 15:50:14 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 f433c3b38005701fdc219ae8c01e6af1b8bedba9 bf90f4052806c8dca636a230c2b8312bca6181ff -- llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp llvm/lib/Target/AMDGPU/GCNSubtarget.h llvm/lib/Target/AMDGPU/SIISelLowering.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index 3a0cdd00d0..17b6e0cb9c 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -16051,8 +16051,8 @@ SITargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *RMW) const {
 
     // TODO: Handle REGION_ADDRESS
     if (AS == AMDGPUAS::LOCAL_ADDRESS) {
-      // DS F32 FP atomics do respect the denormal mode, but the rounding mode is
-      // fixed to round-to-nearest-even.
+      // DS F32 FP atomics do respect the denormal mode, but the rounding mode
+      // is fixed to round-to-nearest-even.
       //
       // F64 / PK_F16 / PK_BF16 never flush and are also fixed to
       // round-to-nearest-even.
@@ -16067,15 +16067,16 @@ SITargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *RMW) const {
 
       if (Ty->isDoubleTy()) {
         // Ignores denormal mode, but we don't consider flushing mandatory.
-        return Subtarget->hasLDSFPAtomicAddF64() ?
-          AtomicExpansionKind::None : AtomicExpansionKind::CmpXChg;
+        return Subtarget->hasLDSFPAtomicAddF64() ? AtomicExpansionKind::None
+                                                 : AtomicExpansionKind::CmpXChg;
       }
 
       // TODO: Handle v2f16/v2bf16 cases for gfx940
       return AtomicExpansionKind::CmpXChg;
     }
 
-    if (!AMDGPU::isFlatGlobalAddrSpace(AS) && AS != AMDGPUAS::BUFFER_FAT_POINTER)
+    if (!AMDGPU::isFlatGlobalAddrSpace(AS) &&
+        AS != AMDGPUAS::BUFFER_FAT_POINTER)
       return AtomicExpansionKind::CmpXChg;
 
     // TODO: gfx940 supports v2f16 and v2bf16

``````````

</details>


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


More information about the llvm-commits mailing list