mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[MIR] Add support for the frame-destroy MachineInstr flag
We are printing / parsing the `frame-setup` MachineInstr flag but not the `frame-destroy` one. Differential Revision: https://reviews.llvm.org/D41509 llvm-svn: 322071
This commit is contained in:
parent
62eaf09505
commit
af104b58a6
@ -365,12 +365,17 @@ machine instructions.
|
||||
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
|
||||
|
@ -211,6 +211,7 @@ static MIToken::TokenKind getIdentifierKind(StringRef Identifier) {
|
||||
.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)
|
||||
|
@ -63,6 +63,7 @@ struct MIToken {
|
||||
kw_renamable,
|
||||
kw_tied_def,
|
||||
kw_frame_setup,
|
||||
kw_frame_destroy,
|
||||
kw_debug_location,
|
||||
kw_cfi_same_value,
|
||||
kw_cfi_offset,
|
||||
|
@ -925,6 +925,9 @@ bool MIParser::parseInstruction(unsigned &OpCode, unsigned &Flags) {
|
||||
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");
|
||||
|
@ -670,6 +670,9 @@ void MIPrinter::print(const MachineInstr &MI) {
|
||||
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 << ' ';
|
||||
|
@ -11,7 +11,7 @@
|
||||
; 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
|
||||
|
@ -30,6 +30,7 @@ body: |
|
||||
; 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
|
||||
...
|
||||
|
Loading…
x
Reference in New Issue
Block a user