@@ -16093,7 +16093,7 @@ static OptimizationRemark emitAtomicRMWLegalRemark(const AtomicRMWInst *RMW) {
16093
16093
<< " operation at memory scope " << MemScope;
16094
16094
}
16095
16095
16096
- static bool isHalf2OrBFloat2 (Type *Ty) {
16096
+ static bool isV2F16OrV2BF16 (Type *Ty) {
16097
16097
if (auto *VT = dyn_cast<FixedVectorType>(Ty)) {
16098
16098
Type *EltTy = VT->getElementType();
16099
16099
return VT->getNumElements() == 2 &&
@@ -16103,12 +16103,12 @@ static bool isHalf2OrBFloat2(Type *Ty) {
16103
16103
return false;
16104
16104
}
16105
16105
16106
- static bool isHalf2 (Type *Ty) {
16106
+ static bool isV2F16 (Type *Ty) {
16107
16107
FixedVectorType *VT = dyn_cast<FixedVectorType>(Ty);
16108
16108
return VT && VT->getNumElements() == 2 && VT->getElementType()->isHalfTy();
16109
16109
}
16110
16110
16111
- static bool isBFloat2 (Type *Ty) {
16111
+ static bool isV2BF16 (Type *Ty) {
16112
16112
FixedVectorType *VT = dyn_cast<FixedVectorType>(Ty);
16113
16113
return VT && VT->getNumElements() == 2 && VT->getElementType()->isBFloatTy();
16114
16114
}
@@ -16248,7 +16248,7 @@ SITargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *RMW) const {
16248
16248
: AtomicExpansionKind::CmpXChg;
16249
16249
}
16250
16250
16251
- if (Subtarget->hasAtomicDsPkAdd16Insts() && isHalf2OrBFloat2 (Ty))
16251
+ if (Subtarget->hasAtomicDsPkAdd16Insts() && isV2F16OrV2BF16 (Ty))
16252
16252
return AtomicExpansionKind::None;
16253
16253
16254
16254
return AtomicExpansionKind::CmpXChg;
@@ -16273,24 +16273,24 @@ SITargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *RMW) const {
16273
16273
if (globalMemoryFPAtomicIsLegal(*Subtarget, RMW, HasSystemScope)) {
16274
16274
if (AS == AMDGPUAS::FLAT_ADDRESS) {
16275
16275
// gfx940, gfx12
16276
- if (Subtarget->hasAtomicFlatPkAdd16Insts() && isHalf2OrBFloat2 (Ty))
16276
+ if (Subtarget->hasAtomicFlatPkAdd16Insts() && isV2F16OrV2BF16 (Ty))
16277
16277
return ReportUnsafeHWInst(AtomicExpansionKind::None);
16278
16278
} else if (AMDGPU::isExtendedGlobalAddrSpace(AS)) {
16279
16279
// gfx90a, gfx940, gfx12
16280
- if (Subtarget->hasAtomicBufferGlobalPkAddF16Insts() && isHalf2 (Ty))
16280
+ if (Subtarget->hasAtomicBufferGlobalPkAddF16Insts() && isV2F16 (Ty))
16281
16281
return ReportUnsafeHWInst(AtomicExpansionKind::None);
16282
16282
16283
16283
// gfx940, gfx12
16284
- if (Subtarget->hasAtomicGlobalPkAddBF16Inst() && isBFloat2 (Ty))
16284
+ if (Subtarget->hasAtomicGlobalPkAddBF16Inst() && isV2BF16 (Ty))
16285
16285
return ReportUnsafeHWInst(AtomicExpansionKind::None);
16286
16286
} else if (AS == AMDGPUAS::BUFFER_FAT_POINTER) {
16287
16287
// gfx90a, gfx940, gfx12
16288
- if (Subtarget->hasAtomicBufferGlobalPkAddF16Insts() && isHalf2 (Ty))
16288
+ if (Subtarget->hasAtomicBufferGlobalPkAddF16Insts() && isV2F16 (Ty))
16289
16289
return ReportUnsafeHWInst(AtomicExpansionKind::None);
16290
16290
16291
16291
// While gfx90a/gfx940 supports v2bf16 for global/flat, it does not for
16292
16292
// buffer. gfx12 does have the buffer version.
16293
- if (Subtarget->hasAtomicBufferPkAddBF16Inst() && isBFloat2 (Ty))
16293
+ if (Subtarget->hasAtomicBufferPkAddBF16Inst() && isV2BF16 (Ty))
16294
16294
return ReportUnsafeHWInst(AtomicExpansionKind::None);
16295
16295
}
16296
16296
@@ -16311,7 +16311,7 @@ SITargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *RMW) const {
16311
16311
// gfx908
16312
16312
if (RMW->use_empty() &&
16313
16313
Subtarget->hasAtomicBufferGlobalPkAddF16NoRtnInsts() &&
16314
- isHalf2 (Ty))
16314
+ isV2F16 (Ty))
16315
16315
return ReportUnsafeHWInst(AtomicExpansionKind::None);
16316
16316
}
16317
16317
}
0 commit comments