machine-outliner-cfi-tail.mir
2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=x86_64-apple-unknown -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s
# Outlining CFI instructions is unsafe if we cannot outline all of the CFI
# instructions from a function. This shows that we choose to outline the
# CFI instructions if they can be included in a tail call.
--- |
define void @foo() #0 { ret void }
define void @bar() #0 { ret void }
define void @baz() #0 { ret void }
attributes #0 = { noredzone }
...
---
name: foo
tracksRegLiveness: true
body: |
bb.0:
; CHECK-LABEL: name: foo
; CHECK: $ecx = MOV32ri 3
; CHECK: CFI_INSTRUCTION def_cfa_offset 16
; CHECK: CFI_INSTRUCTION offset $rbp, -16
; CHECK: CFI_INSTRUCTION def_cfa_register $rsp
; CHECK: TAILJMPd64 @OUTLINED_FUNCTION_0, implicit $rsp, implicit $ssp, implicit-def $eax, implicit-def $edi, implicit-def $edx, implicit-def $esi, implicit $rsp, implicit $ssp
$ecx = MOV32ri 3
CFI_INSTRUCTION def_cfa_offset 16
CFI_INSTRUCTION offset $rbp, -16
CFI_INSTRUCTION def_cfa_register $rsp
$esi = MOV32ri 1
$edx = MOV32ri 2
$edi = MOV32ri 3
$eax = MOV32ri 4
RETQ
...
---
name: bar
tracksRegLiveness: true
body: |
bb.0:
;liveins: $lr
; CHECK-LABEL: name: bar
; CHECK: $ecx = MOV32ri 3
; CHECK: CFI_INSTRUCTION def_cfa_offset 16
; CHECK: CFI_INSTRUCTION offset $rbp, -16
; CHECK: CFI_INSTRUCTION def_cfa_register $rsp
; CHECK: TAILJMPd64 @OUTLINED_FUNCTION_0, implicit $rsp, implicit $ssp, implicit-def $eax, implicit-def $edi, implicit-def $edx, implicit-def $esi, implicit $rsp, implicit $ssp
$ecx = MOV32ri 3
CFI_INSTRUCTION def_cfa_offset 16
CFI_INSTRUCTION offset $rbp, -16
CFI_INSTRUCTION def_cfa_register $rsp
$esi = MOV32ri 1
$edx = MOV32ri 2
$edi = MOV32ri 3
$eax = MOV32ri 4
RETQ
...
---
name: baz
tracksRegLiveness: true
body: |
bb.0:
;liveins: $lr
; CHECK-LABEL: name: baz
; CHECK: $ecx = MOV32ri 3
; CHECK: CFI_INSTRUCTION def_cfa_offset 16
; CHECK: CFI_INSTRUCTION offset $rbp, -16
; CHECK: CFI_INSTRUCTION def_cfa_register $rsp
; CHECK: TAILJMPd64 @OUTLINED_FUNCTION_0, implicit $rsp, implicit $ssp, implicit-def $eax, implicit-def $edi, implicit-def $edx, implicit-def $esi, implicit $rsp, implicit $ssp
$ecx = MOV32ri 3
CFI_INSTRUCTION def_cfa_offset 16
CFI_INSTRUCTION offset $rbp, -16
CFI_INSTRUCTION def_cfa_register $rsp
$esi = MOV32ri 1
$edx = MOV32ri 2
$edi = MOV32ri 3
$eax = MOV32ri 4
RETQ