[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:19 PDT 2025


================
@@ -2006,19 +2006,27 @@ bool AMDGPUInstructionSelector::selectImageIntrinsic(
   MachineInstr &MI, const AMDGPU::ImageDimIntrinsicInfo *Intr) const {
   MachineBasicBlock *MBB = MI.getParent();
   const DebugLoc &DL = MI.getDebugLoc();
+  unsigned IntrOpcode = Intr->BaseOpcode;
+  Register ResultDef;
+  if (MI.getNumExplicitDefs() > 0)
+    ResultDef = MI.getOperand(0).getReg();
----------------
jayfoad wrote:

If you do this after checking `Intr->NoRetBaseOpcode != 0` then you know it's an atomic, so you don't need to check that it has a def operand.

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


More information about the llvm-commits mailing list