[llvm] [AMDGPU] Support image atomic no return instructions (PR #150742)

Mirko BrkuĊĦanin via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 12 10:22:04 PDT 2025


================
@@ -1121,6 +1355,8 @@ multiclass MIMG_Atomic <mimgopc op, string asm, bit isCmpSwap = 0, bit isFP = 0,
       }
     }
   } // End IsAtomicRet = 1
+
+  defm "_NORTN" : MIMG_Atomic_NoReturn <op, asm, isCmpSwap, isFP, renamed>;
----------------
mbrkusanin wrote:

Instead of making a MIMG_Atomic_NoReturn, you can use "foreach" at the start. Something like:
```
 foreach noRtn = [0, 1] in {
    defvar VRtn = !if(noRtn, "_NORTN", "");
    ...
```
and then call existing helper classes with added extra noRtn argument:
```
defm VRtn#_V1 : MIMG_Atomic_Addr_Helper_m <op, asm, noRtn, AVLdSt_32, 1, isFP, renamed>;
```
("noRtn" should be passed all the way down to MIMG_Atomic_*_Base classes, see other inline comment)


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


More information about the llvm-commits mailing list