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

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 19 10:19:25 PDT 2020


ctetreau created this revision.
Herald added subscribers: llvm-commits, psnobl, rkruppe, hiraditya, tschuett.
Herald added a reviewer: efriedma.
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82208

Files:
  llvm/lib/AsmParser/LLParser.cpp


Index: llvm/lib/AsmParser/LLParser.cpp
===================================================================
--- llvm/lib/AsmParser/LLParser.cpp
+++ llvm/lib/AsmParser/LLParser.cpp
@@ -3650,9 +3650,10 @@
             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 @@
         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,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82208.272121.patch
Type: text/x-patch
Size: 1169 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200619/e374cc2f/attachment.bin>


More information about the llvm-commits mailing list