[all-commits] [llvm/llvm-project] c726c9: [SystemZ] Allow %r0 in address context for AsmParser

Ulrich Weigand via All-commits all-commits at lists.llvm.org
Tue Mar 31 10:49:44 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c726c920e04046da29e403d55aa9c0e466b13959
      https://github.com/llvm/llvm-project/commit/c726c920e04046da29e403d55aa9c0e466b13959
  Author: Ulrich Weigand <ulrich.weigand at de.ibm.com>
  Date:   2020-03-31 (Tue, 31 Mar 2020)

  Changed paths:
    M llvm/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp
    M llvm/test/MC/SystemZ/insn-bad-z13.s
    M llvm/test/MC/SystemZ/insn-bad-z14.s
    M llvm/test/MC/SystemZ/insn-bad-z196.s
    M llvm/test/MC/SystemZ/insn-bad-zEC12.s
    M llvm/test/MC/SystemZ/insn-bad.s
    M llvm/test/MC/SystemZ/insn-good.s
    M llvm/test/MC/SystemZ/regs-bad.s
    M llvm/test/MC/SystemZ/tokens.s

  Log Message:
  -----------
  [SystemZ] Allow %r0 in address context for AsmParser

Registers used in any address (as well as in a few other contexts)
have special semantics when a "zero" register is used, which is
why the back-end defines extra register classes ADDR32, ADDR64 etc
to be used to prevent the register allocator from using %r0 there.

However, when writing assembler code "by hand", you sometimes need
to trigger that special semantics.  However, currently the AsmParser
will reject %r0 in those places.  In some cases it may be possible
to write that instruction differently - but in others it is currently
not possible at all.

This check in AsmParser simply seems overly strict, so this patch
just removes the check completely.  This brings the behaviour of
AsmParser in line with the GNU assembler as well.

Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=45092




More information about the All-commits mailing list