[llvm] AMDGPU: Refactor atomicrmw fadd expansion logic (NFC) (PR #89469)
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 23 12:53:18 PDT 2024
================
@@ -16075,56 +16075,50 @@ SITargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *RMW) const {
return AtomicExpansionKind::CmpXChg;
}
- if (!Ty->isFloatTy() && (!Subtarget->hasGFX90AInsts() || !Ty->isDoubleTy()))
+ if (!AMDGPU::isFlatGlobalAddrSpace(AS) &&
+ AS != AMDGPUAS::BUFFER_FAT_POINTER)
return AtomicExpansionKind::CmpXChg;
- if ((AMDGPU::isFlatGlobalAddrSpace(AS) ||
- AS == AMDGPUAS::BUFFER_FAT_POINTER) &&
- Subtarget->hasAtomicFaddNoRtnInsts()) {
- if (Subtarget->hasGFX940Insts())
- return AtomicExpansionKind::None;
+ // TODO: gfx940 supports v2f16 and v2bf16
+ if (Subtarget->hasGFX940Insts() && (Ty->isFloatTy() || Ty->isDoubleTy()))
----------------
rampitec wrote:
I lost the track of this condition after many changes. Can this hasGFX940Insts() be spelled out in terms of a specific feature/target property or its combination? What about gfx11/12, we seem to expand even f32?
https://github.com/llvm/llvm-project/pull/89469
More information about the llvm-commits
mailing list