diff --git a/llvm/lib/Target/AMDGPU/FLATInstructions.td b/llvm/lib/Target/AMDGPU/FLATInstructions.td --- a/llvm/lib/Target/AMDGPU/FLATInstructions.td +++ b/llvm/lib/Target/AMDGPU/FLATInstructions.td @@ -466,7 +466,7 @@ let PseudoInstr = NAME # "_RTN"; } -multiclass FLAT_Atomic_Pseudo< +multiclass FLAT_Atomic_Pseudo_NO_RTN< string opName, RegisterClass vdst_rc, ValueType vt, @@ -484,7 +484,16 @@ let FPAtomic = isFP; let AddedComplexity = -1; // Prefer global atomics if available } +} +multiclass FLAT_Atomic_Pseudo_RTN< + string opName, + RegisterClass vdst_rc, + ValueType vt, + ValueType data_vt = vt, + RegisterClass data_rc = vdst_rc, + bit isFP = isFloatType.ret, + RegisterOperand data_op = getLdStRegisterOperand.ret> { def _RTN : FLAT_AtomicRet_Pseudo .ret:$vdst), (ins VReg_64:$vaddr, data_op:$vdata, flat_offset:$offset, CPol_GLC1:$cpol), @@ -496,6 +505,18 @@ } } +multiclass FLAT_Atomic_Pseudo< + string opName, + RegisterClass vdst_rc, + ValueType vt, + ValueType data_vt = vt, + RegisterClass data_rc = vdst_rc, + bit isFP = isFloatType.ret, + RegisterOperand data_op = getLdStRegisterOperand.ret> { + defm "" : FLAT_Atomic_Pseudo_NO_RTN; + defm "" : FLAT_Atomic_Pseudo_RTN; +} + multiclass FLAT_Global_Atomic_Pseudo_NO_RTN< string opName, RegisterClass vdst_rc,