[SVE] Remove calls to VectorType::getNumElements from AsmParser

Reviewers: efriedma, RKSimon, c-rhodes, fpetrogalli

Reviewed By: fpetrogalli

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82208
This commit is contained in:
Christopher Tetreault 2020-06-23 13:28:55 -07:00
parent 887c0b5665
commit 433c9adf7b

View File

@ -3650,9 +3650,10 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {
ExplicitTypeLoc,
"explicit pointee type doesn't match operand's pointee type");
unsigned GEPWidth = BaseType->isVectorTy()
? cast<VectorType>(BaseType)->getNumElements()
: 0;
unsigned GEPWidth =
BaseType->isVectorTy()
? cast<FixedVectorType>(BaseType)->getNumElements()
: 0;
ArrayRef<Constant *> Indices(Elts.begin() + 1, Elts.end());
for (Constant *Val : Indices) {
@ -3660,7 +3661,7 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {
if (!ValTy->isIntOrIntVectorTy())
return Error(ID.Loc, "getelementptr index must be an integer");
if (auto *ValVTy = dyn_cast<VectorType>(ValTy)) {
unsigned ValNumEl = ValVTy->getNumElements();
unsigned ValNumEl = cast<FixedVectorType>(ValVTy)->getNumElements();
if (GEPWidth && (ValNumEl != GEPWidth))
return Error(
ID.Loc,