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: kparzysz, sdesmalen, efriedma
Reviewed By: kparzysz
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77267
Constant *CVal = nullptr;
bool isVTi1Type = false;
if (auto *CV = dyn_cast<ConstantVector>(CPN->getConstVal())) {
- if (CV->getType()->getVectorElementType()->isIntegerTy(1)) {
+ if (cast<VectorType>(CV->getType())->getElementType()->isIntegerTy(1)) {
IRBuilder<> IRB(CV->getContext());
SmallVector<Constant*, 128> NewConst;
unsigned VecLen = CV->getNumOperands();
}
unsigned HexagonTTIImpl::getTypeNumElements(Type *Ty) const {
- if (Ty->isVectorTy())
- return Ty->getVectorNumElements();
+ if (auto *VTy = dyn_cast<VectorType>(Ty))
+ return VTy->getNumElements();
assert((Ty->isIntegerTy() || Ty->isFloatingPointTy()) &&
"Expecting scalar type");
return 1;