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

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 1 00:21:03 PDT 2023


================
@@ -1946,24 +1946,41 @@ bool MIParser::parseLowLevelType(StringRef::iterator Loc, LLT &Ty) {
 
   // Now we're looking for a vector.
   if (Token.isNot(MIToken::less))
-    return error(Loc,
-                 "expected sN, pA, <M x sN>, or <M x pA> for GlobalISel type");
+    return error(Loc, "expected sN, pA, <M x sN>, <M x pA>, <vscale x M x sN>, "
+                      "or <vscale x M x pA> for GlobalISel type");
   lex();
 
+  bool HasVScale = Token.stringValue() == "vscale";
+  if (HasVScale) {
+    lex();
+    if (Token.stringValue() != "x")
----------------
tschuett wrote:

This access is also unchecked.
```
if (Token.isNot(MIToken::Identifier))
```

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


More information about the llvm-commits mailing list