Skip to content

Commit ef56061

Browse files
committed
AMDGPU: Rename type helper functions in atomic handling
Requested on #95394
1 parent 8454610 commit ef56061

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16093,7 +16093,7 @@ static OptimizationRemark emitAtomicRMWLegalRemark(const AtomicRMWInst *RMW) {
1609316093
<< " operation at memory scope " << MemScope;
1609416094
}
1609516095

16096-
static bool isHalf2OrBFloat2(Type *Ty) {
16096+
static bool isV2F16OrV2BF16(Type *Ty) {
1609716097
if (auto *VT = dyn_cast<FixedVectorType>(Ty)) {
1609816098
Type *EltTy = VT->getElementType();
1609916099
return VT->getNumElements() == 2 &&
@@ -16103,12 +16103,12 @@ static bool isHalf2OrBFloat2(Type *Ty) {
1610316103
return false;
1610416104
}
1610516105

16106-
static bool isHalf2(Type *Ty) {
16106+
static bool isV2F16(Type *Ty) {
1610716107
FixedVectorType *VT = dyn_cast<FixedVectorType>(Ty);
1610816108
return VT && VT->getNumElements() == 2 && VT->getElementType()->isHalfTy();
1610916109
}
1611016110

16111-
static bool isBFloat2(Type *Ty) {
16111+
static bool isV2BF16(Type *Ty) {
1611216112
FixedVectorType *VT = dyn_cast<FixedVectorType>(Ty);
1611316113
return VT && VT->getNumElements() == 2 && VT->getElementType()->isBFloatTy();
1611416114
}
@@ -16248,7 +16248,7 @@ SITargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *RMW) const {
1624816248
: AtomicExpansionKind::CmpXChg;
1624916249
}
1625016250

16251-
if (Subtarget->hasAtomicDsPkAdd16Insts() && isHalf2OrBFloat2(Ty))
16251+
if (Subtarget->hasAtomicDsPkAdd16Insts() && isV2F16OrV2BF16(Ty))
1625216252
return AtomicExpansionKind::None;
1625316253

1625416254
return AtomicExpansionKind::CmpXChg;
@@ -16273,24 +16273,24 @@ SITargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *RMW) const {
1627316273
if (globalMemoryFPAtomicIsLegal(*Subtarget, RMW, HasSystemScope)) {
1627416274
if (AS == AMDGPUAS::FLAT_ADDRESS) {
1627516275
// gfx940, gfx12
16276-
if (Subtarget->hasAtomicFlatPkAdd16Insts() && isHalf2OrBFloat2(Ty))
16276+
if (Subtarget->hasAtomicFlatPkAdd16Insts() && isV2F16OrV2BF16(Ty))
1627716277
return ReportUnsafeHWInst(AtomicExpansionKind::None);
1627816278
} else if (AMDGPU::isExtendedGlobalAddrSpace(AS)) {
1627916279
// gfx90a, gfx940, gfx12
16280-
if (Subtarget->hasAtomicBufferGlobalPkAddF16Insts() && isHalf2(Ty))
16280+
if (Subtarget->hasAtomicBufferGlobalPkAddF16Insts() && isV2F16(Ty))
1628116281
return ReportUnsafeHWInst(AtomicExpansionKind::None);
1628216282

1628316283
// gfx940, gfx12
16284-
if (Subtarget->hasAtomicGlobalPkAddBF16Inst() && isBFloat2(Ty))
16284+
if (Subtarget->hasAtomicGlobalPkAddBF16Inst() && isV2BF16(Ty))
1628516285
return ReportUnsafeHWInst(AtomicExpansionKind::None);
1628616286
} else if (AS == AMDGPUAS::BUFFER_FAT_POINTER) {
1628716287
// gfx90a, gfx940, gfx12
16288-
if (Subtarget->hasAtomicBufferGlobalPkAddF16Insts() && isHalf2(Ty))
16288+
if (Subtarget->hasAtomicBufferGlobalPkAddF16Insts() && isV2F16(Ty))
1628916289
return ReportUnsafeHWInst(AtomicExpansionKind::None);
1629016290

1629116291
// While gfx90a/gfx940 supports v2bf16 for global/flat, it does not for
1629216292
// buffer. gfx12 does have the buffer version.
16293-
if (Subtarget->hasAtomicBufferPkAddBF16Inst() && isBFloat2(Ty))
16293+
if (Subtarget->hasAtomicBufferPkAddBF16Inst() && isV2BF16(Ty))
1629416294
return ReportUnsafeHWInst(AtomicExpansionKind::None);
1629516295
}
1629616296

@@ -16311,7 +16311,7 @@ SITargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *RMW) const {
1631116311
// gfx908
1631216312
if (RMW->use_empty() &&
1631316313
Subtarget->hasAtomicBufferGlobalPkAddF16NoRtnInsts() &&
16314-
isHalf2(Ty))
16314+
isV2F16(Ty))
1631516315
return ReportUnsafeHWInst(AtomicExpansionKind::None);
1631616316
}
1631716317
}

0 commit comments

Comments
 (0)