[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
================
@@ -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;
+ }
const AMDGPU::MIMGBaseOpcodeInfo *BaseOpcode =
- AMDGPU::getMIMGBaseOpcodeInfo(Intr->BaseOpcode);
+ AMDGPU::getMIMGBaseOpcodeInfo(IntrOpcode);
const AMDGPU::MIMGDimInfo *DimInfo = AMDGPU::getMIMGDimInfo(Intr->Dim);
- unsigned IntrOpcode = Intr->BaseOpcode;
bool IsGFX10Plus = AMDGPU::isGFX10Plus(*Subtarget);
bool IsGFX11Plus = AMDGPU::isGFX11Plus(*Subtarget);
bool IsGFX12Plus = AMDGPU::isGFX12Plus(*Subtarget);
SmallVector<EVT, 3> ResultTypes(Op->values());
SmallVector<EVT, 3> OrigResultTypes(Op->values());
+ if (BaseOpcode->NoReturn && BaseOpcode->Atomic) {
+ ResultTypes.clear();
+ ResultTypes.push_back(MVT::Other);
----------------
jayfoad wrote:
Do you also need to modify OrigResultTypes here?
In any case it would be cleaner to create ResultTypes as an empy vector and then append to it, rather than creating it with the wrong contents and then clearing it here.
https://github.com/llvm/llvm-project/pull/150742
More information about the llvm-commits
mailing list