machine-outliner-cfi-tail-some.mir
3.42 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
78
79
80
81
82
83
84
85
86
87
88
89
90
# 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 not to outline the
# CFI instructions since function foo has a CFI Instruction that would not
# be caught.
--- |
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: CFI_INSTRUCTION def_cfa_offset 16
; CHECK: CFI_INSTRUCTION offset $rbp, -16
; CHECK: CFI_INSTRUCTION def_cfa_register $rbp
; CHECK: CALL64pcrel32 @OUTLINED_FUNCTION_1, implicit $rsp, implicit $ssp, implicit-def $eax, implicit-def $ebx, implicit-def $ecx, implicit $rsp, implicit $ssp
; 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
CFI_INSTRUCTION def_cfa_offset 16
CFI_INSTRUCTION offset $rbp, -16
CFI_INSTRUCTION def_cfa_register $rbp
$eax = MOV32ri 1
$ebx = MOV32ri 2
$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: CALL64pcrel32 @OUTLINED_FUNCTION_1, implicit $rsp, implicit $ssp, implicit-def $eax, implicit-def $ebx, implicit-def $ecx, implicit $rsp, implicit $ssp
; 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
$eax = MOV32ri 1
$ebx = MOV32ri 2
$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: CALL64pcrel32 @OUTLINED_FUNCTION_1, implicit $rsp, implicit $ssp, implicit-def $eax, implicit-def $ebx, implicit-def $ecx, implicit $rsp, implicit $ssp
; 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
$eax = MOV32ri 1
$ebx = MOV32ri 2
$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