2 # RUN: llc -mtriple=aarch64-linux-gnu -run-pass=machine-outliner \
3 # RUN: -machine-outliner-reruns=0 -verify-machineinstrs %s -o - | FileCheck --check-prefix=ITER1 %s
5 # RUN: llc -mtriple=aarch64-linux-gnu -run-pass=machine-outliner \
6 # RUN: -machine-outliner-reruns=1 -verify-machineinstrs %s -o - | FileCheck --check-prefix=ITER2 %s
8 # RUN: llc -mtriple=aarch64-linux-gnu -run-pass=machine-outliner \
9 # RUN: -machine-outliner-reruns=2 -debug-only=machine-outliner \
10 # RUN: -verify-machineinstrs %s -o /dev/null 2>&1 | FileCheck --check-prefix=ITER3 %s
13 declare void @z1(i32, i32)
14 declare void @z2(i32, i32, i32)
15 define void @a(i32 %p1) { unreachable }
16 define void @b(i32 %p1) { unreachable }
20 #ITER1: $w19 = ORRWrs $wzr, killed $w0, 0
21 #ITER1-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
22 #ITER1-NEXT: $w1 = ORRWri $wzr, 1
23 #ITER1-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
24 #ITER1-NEXT: $w1 = ORRWri $wzr, 1984
25 #ITER1-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
26 #ITER1-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
29 #ITER2: $w19 = ORRWrs $wzr, killed $w0, 0
30 #ITER2-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
31 #ITER2-NEXT: $w1 = ORRWri $wzr, 1
32 #ITER2-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
33 #ITER2-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
34 #ITER2-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
36 tracksRegLiveness: true
38 - { reg: '$w0', virtual-reg: '' }
43 liveins: $w0, $lr, $x19
45 early-clobber $sp = frame-setup STPXpre killed $x19, killed $lr, $sp, -2 :: (store (s64)), (store (s64))
46 $w19 = ORRWrs $wzr, killed $w0, 0
49 BL @z1, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $w0, implicit killed $w1, implicit-def $sp
51 $w2 = ORRWri $wzr, 1920
52 $w0 = ORRWrs $wzr, $w19, 0
53 BL @z2, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $w0, implicit killed $w1, implicit killed $w2, implicit-def $sp
54 $w1 = ORRWri $wzr, 1984
55 $w2 = ORRWri $wzr, 1920
56 $w0 = ORRWrs $wzr, killed $w19, 0
57 BL @z2, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $w0, implicit killed $w1, implicit killed $w2, implicit-def $sp
60 BL @z1, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $w0, implicit killed $w1, implicit-def $sp
61 early-clobber $sp, $x19, $lr = frame-destroy LDPXpost $sp, 2 :: (load (s64)), (load (s64))
67 #ITER1: $w19 = ORRWrs $wzr, killed $w0, 0
68 #ITER1-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
69 #ITER1-NEXT: $w1 = ORRWri $wzr, 1984
70 #ITER1-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
71 #ITER1-NEXT: $w1 = ORRWri $wzr, 1984
72 #ITER1-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
73 #ITER1-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
76 #ITER2: $w19 = ORRWrs $wzr, killed $w0, 0
77 #ITER2-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
78 #ITER2-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
79 #ITER2-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
80 #ITER2-NEXT: BL @OUTLINED_FUNCTION_{{[0-9]+}}
82 tracksRegLiveness: true
84 - { reg: '$w0', virtual-reg: '' }
89 liveins: $w0, $lr, $x19
91 early-clobber $sp = frame-setup STPXpre killed $x19, killed $lr, $sp, -2 :: (store (s64)), (store (s64))
92 $w19 = ORRWrs $wzr, killed $w0, 0
95 BL @z1, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $w0, implicit killed $w1, implicit-def $sp
96 $w1 = ORRWri $wzr, 1984
97 $w2 = ORRWri $wzr, 1920
98 $w0 = ORRWrs $wzr, $w19, 0
99 BL @z2, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $w0, implicit killed $w1, implicit killed $w2, implicit-def $sp
100 $w1 = ORRWri $wzr, 1984
101 $w2 = ORRWri $wzr, 1920
102 $w0 = ORRWrs $wzr, killed $w19, 0
103 BL @z2, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $w0, implicit killed $w1, implicit killed $w2, implicit-def $sp
106 BL @z1, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $w0, implicit killed $w1, implicit-def $sp
107 early-clobber $sp, $x19, $lr = frame-destroy LDPXpost $sp, 2 :: (load (s64)), (load (s64))
111 #ITER1-LABEL: name: OUTLINED_FUNCTION_{{[0-9]+}}
112 #ITER1-LABEL: name: OUTLINED_FUNCTION_{{[0-9]+}}
114 #ITER2-LABEL: name: OUTLINED_FUNCTION_{{[0-9]+}}
115 #ITER2-LABEL: name: OUTLINED_FUNCTION_{{[0-9]+}}
116 #ITER2-LABEL: name: OUTLINED_FUNCTION_{{[0-9]+}}
118 # ITER3: Did not outline on iteration 3 out of 3