[llvm] [AArch64] When printing SYS aliases, use explicit `NeedsReg` flag from tablegen (NFC) (PR #140484)

Jonathan Thackray via llvm-commits llvm-commits at lists.llvm.org
Mon May 19 02:52:13 PDT 2025


================
@@ -3917,6 +3917,7 @@ bool AArch64AsmParser::parseSysAlias(StringRef Name, SMLoc NameLoc,
   const AsmToken &Tok = getTok();
   StringRef Op = Tok.getString();
   SMLoc S = Tok.getLoc();
+  bool ExpectRegister = true;
----------------
jthackray wrote:

You would think so. But no. Almost all of these `SYS` alias instructions actually do require a register parameter, and only if `NeedsReg` is provided and is set to zero will it be turned off.

It might be better to deprecate the `SysAlias` class, and just use `SysAliasReg` and make it explicit that the `AT` instructions (for example), despite using `SysAlias`, all require a register for those instructions, e.g. `at s1e1a, x1`

However, that's a much larger change. I'll think about whether it's worth implementing.

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


More information about the llvm-commits mailing list