Skip to content

Commit e634f48

Browse files
Clean up usages of asserting vector getters in Type
Summary: Remove usages of asserting vector getters in Type in preparation for the VectorType refactor. The existence of these functions complicates the refactor while adding little value. Reviewers: arsenm, efriedma, sdesmalen Reviewed By: arsenm Subscribers: wdng, arsenm, jvesely, nhaehnle, hiraditya, kerbowa, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77268
1 parent 6ed88af commit e634f48

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ ValueType MetadataStreamerV2::getValueType(Type *Ty, StringRef TypeName) const {
153153
case Type::PointerTyID:
154154
return getValueType(Ty->getPointerElementType(), TypeName);
155155
case Type::VectorTyID:
156-
return getValueType(Ty->getVectorElementType(), TypeName);
156+
return getValueType(cast<VectorType>(Ty)->getElementType(), TypeName);
157157
default:
158158
return ValueType::Struct;
159159
}
@@ -188,7 +188,7 @@ std::string MetadataStreamerV2::getTypeName(Type *Ty, bool Signed) const {
188188
case Type::VectorTyID: {
189189
auto VecTy = cast<VectorType>(Ty);
190190
auto ElTy = VecTy->getElementType();
191-
auto NumElements = VecTy->getVectorNumElements();
191+
auto NumElements = VecTy->getNumElements();
192192
return (Twine(getTypeName(ElTy, Signed)) + Twine(NumElements)).str();
193193
}
194194
default:
@@ -600,7 +600,7 @@ StringRef MetadataStreamerV3::getValueType(Type *Ty, StringRef TypeName) const {
600600
case Type::PointerTyID:
601601
return getValueType(Ty->getPointerElementType(), TypeName);
602602
case Type::VectorTyID:
603-
return getValueType(Ty->getVectorElementType(), TypeName);
603+
return getValueType(cast<VectorType>(Ty)->getElementType(), TypeName);
604604
default:
605605
return "struct";
606606
}
@@ -635,7 +635,7 @@ std::string MetadataStreamerV3::getTypeName(Type *Ty, bool Signed) const {
635635
case Type::VectorTyID: {
636636
auto VecTy = cast<VectorType>(Ty);
637637
auto ElTy = VecTy->getElementType();
638-
auto NumElements = VecTy->getVectorNumElements();
638+
auto NumElements = VecTy->getNumElements();
639639
return (Twine(getTypeName(ElTy, Signed)) + Twine(NumElements)).str();
640640
}
641641
default:

llvm/lib/Target/AMDGPU/AMDGPULowerKernelArguments.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ bool AMDGPULowerKernelArguments::runOnFunction(Function &F) {
152152
}
153153

154154
if (IsV3 && Size >= 32) {
155-
V4Ty = VectorType::get(VT->getVectorElementType(), 4);
155+
V4Ty = VectorType::get(VT->getElementType(), 4);
156156
// Use the hack that clang uses to avoid SelectionDAG ruining v3 loads
157157
AdjustedArgTy = V4Ty;
158158
}

0 commit comments

Comments
 (0)