[llvm] [CodeGen][MIR] Support parsing of scalable vectors in MIR (PR #70893)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 31 23:56:10 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")
+ return error("expected <vscale x M x sN> or <vscale x M x pA>");
+ lex();
+ }
+
+ auto GetError = [&](bool HasVScale, StringRef::iterator Loc) {
----------------
topperc wrote:
You can capture HasVScale instead of passing it.
https://github.com/llvm/llvm-project/pull/70893
More information about the llvm-commits
mailing list