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

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 12 06:52:21 PDT 2025


================
@@ -8752,16 +8752,24 @@ SDValue SITargetLowering::lowerImage(SDValue Op,
   SDLoc DL(Op);
   MachineFunction &MF = DAG.getMachineFunction();
   const GCNSubtarget *ST = &MF.getSubtarget<GCNSubtarget>();
+  unsigned IntrOpcode = Intr->BaseOpcode;
+  if (!Op.getNode()->hasAnyUseOfValue(0)) {
+    if (Intr->NoRetBaseOpcode != 0 && Intr->NoRetBaseOpcode != Intr->BaseOpcode)
+      IntrOpcode = Intr->NoRetBaseOpcode;
+  }
----------------
jayfoad wrote:

Simplify, and check it's an atomic before looking at uses of the return value (otherwise it might be a store which has no return value):
```suggestion
  if (Intr->NoRetBaseOpcode != 0 && !Op.getNode()->hasAnyUseOfValue(0))
    IntrOpcode = Intr->NoRetBaseOpcode;
```

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


More information about the llvm-commits mailing list