Skip to content

Commit 0fd67a8

Browse files
author
Stefan Stipanovic
committed
rename isRegType and add comment
1 parent 0f19020 commit 0fd67a8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ static bool isRegisterVectorType(LLT Ty) {
235235
EltSize == 128 || EltSize == 256;
236236
}
237237

238+
// TODO: replace all uses of isRegisterType with isRegisterClassType
238239
static bool isRegisterType(LLT Ty) {
239240
if (!isRegisterSize(Ty.getSizeInBits()))
240241
return false;
@@ -342,7 +343,8 @@ static LLT GetAddrSpacePtr(unsigned AS, const GCNTargetMachine &TM) {
342343
return LLT::pointer(AS, TM.getPointerSizeInBits(AS));
343344
}
344345

345-
static bool isRegType(LLT Ty, const GCNTargetMachine &TM) {
346+
// Checks whether a type is in the list of legal register types.
347+
static bool isRegisterClassType(LLT Ty, const GCNTargetMachine &TM) {
346348
const LLT GlobalPtr = GetAddrSpacePtr(AMDGPUAS::GLOBAL_ADDRESS, TM);
347349
const LLT LocalPtr = GetAddrSpacePtr(AMDGPUAS::LOCAL_ADDRESS, TM);
348350
const LLT FlatPtr = GetAddrSpacePtr(AMDGPUAS::FLAT_ADDRESS, TM);
@@ -363,10 +365,10 @@ static bool isRegType(LLT Ty, const GCNTargetMachine &TM) {
363365
typeInSet(Ty, AllPtrTypes) || Ty.isPointer();
364366
}
365367

366-
static LegalityPredicate isRegType(unsigned TypeIdx,
368+
static LegalityPredicate isRegisterClassType(unsigned TypeIdx,
367369
const GCNTargetMachine &TM) {
368370
return [TypeIdx, &TM](const LegalityQuery &Query) {
369-
return isRegType(Query.Types[TypeIdx], TM);
371+
return isRegisterClassType(Query.Types[TypeIdx], TM);
370372
};
371373
}
372374

@@ -860,7 +862,7 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST_,
860862

861863
getActionDefinitionsBuilder(G_BITCAST)
862864
// Don't worry about the size constraint.
863-
.legalIf(all(isRegType(0, TM), isRegType(1, TM)))
865+
.legalIf(all(isRegisterClassType(0, TM), isRegisterClassType(1, TM)))
864866
.lower();
865867

866868
getActionDefinitionsBuilder(G_CONSTANT)

0 commit comments

Comments
 (0)