1 # RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass machine-outliner -verify-machineinstrs -enable-machine-outliner %s -o - | FileCheck %s
3 ; Function Attrs: minsize
4 declare void @foo(i32, i32, i32, i32) #0
6 ; Function Attrs: nounwind
7 define void @xray0(i1 %a) #1 {
9 br i1 %a, label %if.then, label %if.end
11 if.then: ; preds = %entry
12 call void @foo(i32 1, i32 2, i32 3, i32 4)
15 if.end: ; preds = %if.then, %entry
16 call void @foo(i32 5, i32 6, i32 7, i32 8)
20 ; Function Attrs: nounwind
21 define void @xray1(i1 %a) #1 {
23 br i1 %a, label %if.then, label %if.end
25 if.then: ; preds = %entry
26 call void @foo(i32 1, i32 2, i32 3, i32 4)
29 if.end: ; preds = %if.then, %entry
30 call void @foo(i32 5, i32 6, i32 7, i32 8)
34 attributes #0 = { minsize }
35 attributes #1 = { nounwind "function-instrument"="xray-always" }
40 tracksRegLiveness: true
42 - { reg: '$w0', virtual-reg: '' }
44 - { id: 0, name: '', type: spill-slot, offset: -16, size: 8, alignment: 16,
45 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
46 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
50 ; CHECK-LABEL: name: xray0
52 ; CHECK: PATCHABLE_FUNCTION_ENTER
53 ; CHECK: bb.1.if.then:
54 ; CHECK: BL @[[OUTLINED_FUNCTION:OUTLINED_FUNCTION_[0-9]]]
56 ; CHECK-NEXT: $w0 = MOVZWi 5, 0
57 ; CHECK-NEXT: $w1 = MOVZWi 6, 0
58 ; CHECK-NEXT: $w2 = MOVZWi 7, 0
59 ; CHECK-NEXT: $w3 = MOVZWi 8, 0
60 ; CHECK-NEXT: BL @foo, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $w0, implicit killed $w1, implicit killed $w2, implicit killed $w3, implicit-def $sp
61 ; CHECK: $w0 = MOVZWi 5, 0
62 ; CHECK-NEXT: $w1 = MOVZWi 6, 0
63 ; CHECK-NEXT: PATCHABLE_FUNCTION_EXIT
64 ; CHECK-NEXT: RET undef $lr
67 successors: %bb.1(0x40000000), %bb.2(0x40000000)
70 PATCHABLE_FUNCTION_ENTER
71 early-clobber $sp = frame-setup STRXpre killed $lr, $sp, -16 :: (store (s64) into %stack.0)
72 TBZW killed renamable $w0, 0, %bb.2
75 successors: %bb.2(0x80000000)
81 BL @foo, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $w0, implicit killed $w1, implicit killed $w2, implicit killed $w3, implicit-def $sp
88 BL @foo, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $w0, implicit killed $w1, implicit killed $w2, implicit killed $w3, implicit-def $sp
89 early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)
92 PATCHABLE_FUNCTION_EXIT
98 tracksRegLiveness: true
100 - { reg: '$w0', virtual-reg: '' }
102 - { id: 0, name: '', type: spill-slot, offset: -16, size: 8, alignment: 16,
103 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
104 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
108 ; CHECK-LABEL: name: xray1
110 ; CHECK: PATCHABLE_FUNCTION_ENTER
111 ; CHECK: bb.1.if.then:
112 ; CHECK: BL @[[OUTLINED_FUNCTION]]
113 ; CHECK: bb.2.if.end:
114 ; CHECK-NEXT: $w0 = MOVZWi 5, 0
115 ; CHECK-NEXT: $w1 = MOVZWi 6, 0
116 ; CHECK-NEXT: $w2 = MOVZWi 7, 0
117 ; CHECK-NEXT: $w3 = MOVZWi 8, 0
118 ; CHECK-NEXT: BL @foo, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $w0, implicit killed $w1, implicit killed $w2, implicit killed $w3, implicit-def $sp
119 ; CHECK: $w0 = MOVZWi 5, 0
120 ; CHECK-NEXT: $w1 = MOVZWi 6, 0
121 ; CHECK-NEXT: PATCHABLE_FUNCTION_EXIT
122 ; CHECK-NEXT: RET undef $lr
125 successors: %bb.1(0x40000000), %bb.2(0x40000000)
128 PATCHABLE_FUNCTION_ENTER
129 early-clobber $sp = frame-setup STRXpre killed $lr, $sp, -16 :: (store (s64) into %stack.0)
130 TBZW killed renamable $w0, 0, %bb.2
133 successors: %bb.2(0x80000000)
139 BL @foo, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $w0, implicit killed $w1, implicit killed $w2, implicit killed $w3, implicit-def $sp
146 BL @foo, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $w0, implicit killed $w1, implicit killed $w2, implicit killed $w3, implicit-def $sp
147 early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)
150 PATCHABLE_FUNCTION_EXIT
153 ; CHECK: name: [[OUTLINED_FUNCTION]]
155 ; CHECK: $w0 = MOVZWi 1, 0
156 ; CHECK-NEXT: $w1 = MOVZWi 2, 0
157 ; CHECK-NEXT: $w2 = MOVZWi 3, 0
158 ; CHECK-NEXT: $w3 = MOVZWi 4, 0
159 ; CHECK-NEXT: TCRETURNdi @foo, 0, implicit $sp