[llvm] 433c9ad - [SVE] Remove calls to VectorType::getNumElements from AsmParser
Christopher Tetreault via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 23 14:32:03 PDT 2020
Author: Christopher Tetreault
Date: 2020-06-23T14:31:49-07:00
New Revision: 433c9adf7b2bea8577a15b5e8c38f2844b965be8
URL: https://github.com/llvm/llvm-project/commit/433c9adf7b2bea8577a15b5e8c38f2844b965be8
DIFF: https://github.com/llvm/llvm-project/commit/433c9adf7b2bea8577a15b5e8c38f2844b965be8.diff
LOG: [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
Added:
Modified:
llvm/lib/AsmParser/LLParser.cpp
Removed:
################################################################################
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 4e75ca4ae535..9bd56cddb5c7 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -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,
More information about the llvm-commits
mailing list