Skip to content

Commit 5b01522

Browse files
authored
[AMDGPU] Use LLT::isPointerOrPointerVector in legalizer (#81582)
1 parent 270f2c5 commit 5b01522

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,8 @@ static std::initializer_list<LLT> AllS64Vectors = {V2S64, V3S64, V4S64, V5S64,
342342

343343
// Checks whether a type is in the list of legal register types.
344344
static bool isRegisterClassType(LLT Ty) {
345-
if (Ty.isVector() && Ty.getElementType().isPointer())
346-
Ty = LLT::fixed_vector(Ty.getNumElements(),
347-
LLT::scalar(Ty.getScalarSizeInBits()));
348-
else if (Ty.isPointer())
349-
Ty = LLT::scalar(Ty.getScalarSizeInBits());
345+
if (Ty.isPointerOrPointerVector())
346+
Ty = Ty.changeElementType(LLT::scalar(Ty.getScalarSizeInBits()));
350347

351348
return is_contained(AllS32Vectors, Ty) || is_contained(AllS64Vectors, Ty) ||
352349
is_contained(AllScalarTypes, Ty) || is_contained(AllS16Vectors, Ty);

0 commit comments

Comments
 (0)