[llvm] [AArch64][llvm] Add support for optional register in `SYS` alias instructions (PR #153905)

Jonathan Thackray via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 18 03:21:08 PDT 2025


================
@@ -1017,13 +1018,24 @@ bool AArch64InstPrinter::printSysAlias(const MCInst *MI,
   else
     return false;
 
+  StringRef Reg = getRegisterName(MI->getOperand(4).getReg());
+  bool NotXZR = Reg != "xzr";
+
+  // If a mandatory or optional register is not specified in the TableGen
+  // (i.e. no register operand should be present), and the register value
+  // is not xzr/x31, then disassemble to a SYS alias instead.
+  if (NotXZR && !NeedsReg && !OptionalReg)
----------------
jthackray wrote:

Sure, I'll re-add in a month or so shortly when it's required for other code changes.

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


More information about the llvm-commits mailing list