diff --git a/llvm/lib/Target/SystemZ/SystemZInstrInfo.td b/llvm/lib/Target/SystemZ/SystemZInstrInfo.td index d5d56ecf6e47bd..a2e207aedcde2f 100644 --- a/llvm/lib/Target/SystemZ/SystemZInstrInfo.td +++ b/llvm/lib/Target/SystemZ/SystemZInstrInfo.td @@ -101,10 +101,14 @@ let isBranch = 1, isTerminator = 1, isBarrier = 1 in { } } -// NOPs. These are again variants of the conditional branches, -// with the condition mask set to "never". +// NOPs. These are again variants of the conditional branches, with the +// condition mask set to "never". NOP_bare can't be an InstAlias since it +// would need R0D hard coded which is not part of ADDR64BitRegClass. def NOP : InstAlias<"nop\t$XBD", (BCAsm 0, bdxaddr12only:$XBD), 0>; +let isAsmParserOnly = 1, hasNoSchedulingInfo = 1, M1 = 0, XBD2 = 0 in + def NOP_bare : InstRXb<0x47,(outs), (ins), "nop", []>; def NOPR : InstAlias<"nopr\t$R", (BCRAsm 0, GR64:$R), 0>; +def NOPR_bare : InstAlias<"nopr", (BCRAsm 0, R0D), 0>; // Fused compare-and-branch instructions. // diff --git a/llvm/test/MC/SystemZ/insn-good.s b/llvm/test/MC/SystemZ/insn-good.s index 07f721bfa5e496..f75db59211b394 100644 --- a/llvm/test/MC/SystemZ/insn-good.s +++ b/llvm/test/MC/SystemZ/insn-good.s @@ -12284,10 +12284,14 @@ niy 524287(%r15), 42 #CHECK: bc 0, 0 # encoding: [0x47,0x00,0x00,0x00] +#CHECK: nop # encoding: [0x47,0x00,0x00,0x00] #CHECK: bcr 0, %r7 # encoding: [0x07,0x07] +#CHECK: bcr 0, %r0 # encoding: [0x07,0x00] nop 0 + nop nopr %r7 + nopr #CHECK: nr %r0, %r0 # encoding: [0x14,0x00] #CHECK: nr %r0, %r15 # encoding: [0x14,0x0f]