1 # RUN: llc -mtriple=aarch64--- -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s
2 # RUN: llc -mtriple=aarch64--- -outliner-benefit-threshold=10 -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=THRESHOLD
5 define void @baz() #0 {
9 define void @bar(i32 %a) #0 {
13 attributes #0 = { noredzone }
16 # Check that two we outline two different sequences, one from bb1 and one from
17 # bb2 when the threshold is 1.
19 # CHECK: BL @OUTLINED_FUNCTION_[[F0:[0-9]+]], implicit-def $lr, implicit $sp
20 # CHECK-NEXT: $w11 = ORRWri $wzr, 1
21 # CHECK-NEXT: $w11 = ORRWri $wzr, 1
22 # CHECK-NEXT: $w11 = ORRWri $wzr, 2
23 # CHECK-NEXT: BL @baz, implicit-def dead $lr, implicit $sp
24 # CHECK-NEXT: BL @OUTLINED_FUNCTION_[[F0]], implicit-def $lr, implicit $sp
25 # CHECK-NEXT: $w11 = ORRWri $wzr, 1
26 # CHECK-NEXT: $w11 = ORRWri $wzr, 1
27 # CHECK-NEXT: $w8 = ORRWri $wzr, 0
28 # CHECK-NOT: $w11 = KILL renamable $w11, implicit killed $w11
31 # CHECK: BL @OUTLINED_FUNCTION_[[F1:[0-9]+]], implicit-def $lr, implicit $sp
32 # CHECK-NEXT: $w9 = ORRWri $wzr, 0
33 # CHECK-NEXT: BL @OUTLINED_FUNCTION_[[F1]], implicit-def $lr, implicit $sp
34 # CHECK-NEXT: $w8 = ORRWri $wzr, 0
35 # CHECK-NOT: $w11 = KILL renamable $w11, implicit killed $w11
37 # Check that the sequences in bb.2 don't get outlined with a threshold of 10 but
38 # the sequences in bb.1 do.
39 # THRESHOLD-LABEL: bb.1:
40 # THRESHOLD: BL @OUTLINED_FUNCTION_[[F0:[0-9]+]], implicit-def $lr, implicit $sp
41 # THRESHOLD-NEXT: $w11 = ORRWri $wzr, 1
42 # THRESHOLD-NEXT: $w11 = ORRWri $wzr, 1
43 # THRESHOLD-NEXT: $w11 = ORRWri $wzr, 2
44 # THRESHOLD-NEXT: BL @baz, implicit-def dead $lr, implicit $sp
45 # THRESHOLD-NEXT: BL @OUTLINED_FUNCTION_[[F0]], implicit-def $lr, implicit $sp
46 # THRESHOLD-NEXT: $w11 = ORRWri $wzr, 1
47 # THRESHOLD-NEXT: $w11 = ORRWri $wzr, 1
48 # THRESHOLD-NEXT: $w8 = ORRWri $wzr, 0
49 # THRESHOLD-NOT: $w11 = KILL renamable $w11, implicit killed $w11
51 # THRESHOLD-LABEL: bb.2:
52 # THRESHOLD-NOT: BL @OUTLINED_FUNCTION
54 tracksRegLiveness: true
57 liveins: $w0, $lr, $w8
58 $sp = frame-setup SUBXri $sp, 32, 0
59 $fp = frame-setup ADDXri $sp, 16, 0
62 BL @baz, implicit-def dead $lr, implicit $sp
65 $w11 = KILL renamable $w11, implicit killed $w11
68 BL @baz, implicit-def dead $lr, implicit $sp
72 BL @baz, implicit-def dead $lr, implicit $sp
77 BL @baz, implicit-def dead $lr, implicit $sp
87 $x15 = ADDXri $sp, 48, 0;
93 $x15 = ADDXri $sp, 48, 0;
97 $fp, $lr = LDPXi $sp, 2
98 $sp = ADDXri $sp, 32, 0
104 tracksRegLiveness: true
107 liveins: $w0, $lr, $w8
110 # CHECK-LABEL: name: OUTLINED_FUNCTION_{{[0-9]}}
111 # CHECK-LABEL: name: OUTLINED_FUNCTION_{{[1-9]}}
113 # THRESHOLD-LABEL: name: OUTLINED_FUNCTION_{{[0-9]}}
114 # THRESHOLD-NOT: name: OUTLINED_FUNCTION_{{[1-9]}}