[llvm] [CodeGen][MIR] Support parsing of scalable vectors in MIR (PR #70893)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 1 00:11:10 PDT 2023


================
@@ -1981,14 +1998,18 @@ bool MIParser::parseLowLevelType(StringRef::iterator Loc, LLT &Ty) {
 
     Ty = LLT::pointer(AS, DL.getPointerSizeInBits(AS));
   } else
-    return error(Loc, "expected <M x sN> or <M x pA> for vector type");
+    return GetError(HasVScale, Loc);
   lex();
 
   if (Token.isNot(MIToken::greater))
-    return error(Loc, "expected <M x sN> or <M x pA> for vector type");
+    return GetError(HasVScale, Loc);
+
   lex();
 
-  Ty = LLT::fixed_vector(NumElements, Ty);
+  if (HasVScale)
----------------
topperc wrote:

You could do `Ty = LLT::vector(ElementCount::get(NumElements, HasVScale), Ty)`

https://github.com/llvm/llvm-project/pull/70893


More information about the llvm-commits mailing list