We are printing / parsing the `frame-setup` MachineInstr flag but not
the `frame-destroy` one.
Differential Revision: https://reviews.llvm.org/D41509
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322071
91177308-0d34-0410-b5e6-
96231b3b80d8
Instruction Flags
^^^^^^^^^^^^^^^^^
-The flag ``frame-setup`` can be specified before the instruction's name:
+The flag ``frame-setup`` or ``frame-destroy`` can be specified before the
+instruction's name:
.. code-block:: text
%fp = frame-setup ADDXri %sp, 0, 0
+.. code-block:: text
+
+ %x21, %x20 = frame-destroy LDPXi %sp
+
.. _registers:
Registers
.Case("renamable", MIToken::kw_renamable)
.Case("tied-def", MIToken::kw_tied_def)
.Case("frame-setup", MIToken::kw_frame_setup)
+ .Case("frame-destroy", MIToken::kw_frame_destroy)
.Case("debug-location", MIToken::kw_debug_location)
.Case("same_value", MIToken::kw_cfi_same_value)
.Case("offset", MIToken::kw_cfi_offset)
kw_renamable,
kw_tied_def,
kw_frame_setup,
+ kw_frame_destroy,
kw_debug_location,
kw_cfi_same_value,
kw_cfi_offset,
if (Token.is(MIToken::kw_frame_setup)) {
Flags |= MachineInstr::FrameSetup;
lex();
+ } else if (Token.is(MIToken::kw_frame_destroy)) {
+ Flags |= MachineInstr::FrameDestroy;
+ lex();
}
if (Token.isNot(MIToken::Identifier))
return error("expected a machine instruction");
OS << " = ";
if (MI.getFlag(MachineInstr::FrameSetup))
OS << "frame-setup ";
+ else if (MI.getFlag(MachineInstr::FrameDestroy))
+ OS << "frame-destroy ";
+
OS << TII->getName(MI.getOpcode());
if (I < E)
OS << ' ';
; CHECK: Before post-MI-sched:
; CHECK-LABEL: # Machine code for function test1:
; CHECK: SU(2): STRWui %wzr
-; CHECK: SU(3): %x21, %x20 = LDPXi %sp
+; CHECK: SU(3): %x21, %x20 = LDPXi %sp, 2; flags: FrameDestroy
; CHECK: Predecessors:
; CHECK-NEXT: SU(0): Out
; CHECK-NEXT: SU(0): Out
; CHECK: frame-setup PUSH64r %rax
frame-setup PUSH64r %rax, implicit-def %rsp, implicit %rsp
CALL64pcrel32 @compute, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax
- %rdx = POP64r implicit-def %rsp, implicit %rsp
+ ; CHECK: %rdx = frame-destroy POP64r
+ %rdx = frame-destroy POP64r implicit-def %rsp, implicit %rsp
RETQ %eax
...