1 ; RUN: llc -verify-machineinstrs -enable-machine-outliner -mtriple=aarch64-apple-darwin < %s | FileCheck %s
2 ; RUN: llc -verify-machineinstrs -enable-machine-outliner -mtriple=aarch64-apple-darwin -mcpu=cortex-a53 -enable-misched=false < %s | FileCheck %s
3 ; RUN: llc -verify-machineinstrs -enable-machine-outliner -enable-linkonceodr-outlining -mtriple=aarch64-apple-darwin < %s | FileCheck %s -check-prefix=ODR
4 ; RUN: llc -verify-machineinstrs -enable-machine-outliner -mtriple=aarch64-apple-darwin -stop-after=machine-outliner < %s | FileCheck %s -check-prefix=TARGET_FEATURES
6 ; Make sure that we inherit target features from functions and make sure we have
7 ; the right function attributes.
8 ; TARGET_FEATURES: define internal void @OUTLINED_FUNCTION_{{[0-9]+}}()
9 ; TARGET_FEATURES-SAME: #[[ATTR_NUM:[0-9]+]]
10 ; TARGET_FEATURES-DAG: attributes #[[ATTR_NUM]] = {
11 ; TARGET_FEATURES-SAME: minsize
12 ; TARGET_FEATURES-SAME: optsize
13 ; TARGET_FEATURES-SAME: "target-features"="+sse"
15 define linkonce_odr void @fish() #0 {
18 ; ODR: [[OUTLINED:OUTLINED_FUNCTION_[0-9]+]]
19 %1 = alloca i32, align 4
20 %2 = alloca i32, align 4
21 %3 = alloca i32, align 4
22 %4 = alloca i32, align 4
23 %5 = alloca i32, align 4
24 %6 = alloca i32, align 4
25 store i32 1, i32* %1, align 4
26 store i32 2, i32* %2, align 4
27 store i32 3, i32* %3, align 4
28 store i32 4, i32* %4, align 4
29 store i32 5, i32* %5, align 4
30 store i32 6, i32* %6, align 4
34 define void @turtle() section "TURTLE,turtle" {
35 ; CHECK-LABEL: _turtle:
38 %1 = alloca i32, align 4
39 %2 = alloca i32, align 4
40 %3 = alloca i32, align 4
41 %4 = alloca i32, align 4
42 %5 = alloca i32, align 4
43 %6 = alloca i32, align 4
44 store i32 1, i32* %1, align 4
45 store i32 2, i32* %2, align 4
46 store i32 3, i32* %3, align 4
47 store i32 4, i32* %4, align 4
48 store i32 5, i32* %5, align 4
49 store i32 6, i32* %6, align 4
53 define void @cat() #0 {
55 ; CHECK: [[OUTLINED:OUTLINED_FUNCTION_[0-9]+]]
57 %1 = alloca i32, align 4
58 %2 = alloca i32, align 4
59 %3 = alloca i32, align 4
60 %4 = alloca i32, align 4
61 %5 = alloca i32, align 4
62 %6 = alloca i32, align 4
63 store i32 1, i32* %1, align 4
64 store i32 2, i32* %2, align 4
65 store i32 3, i32* %3, align 4
66 store i32 4, i32* %4, align 4
67 store i32 5, i32* %5, align 4
68 store i32 6, i32* %6, align 4
72 define void @dog() #0 {
76 %1 = alloca i32, align 4
77 %2 = alloca i32, align 4
78 %3 = alloca i32, align 4
79 %4 = alloca i32, align 4
80 %5 = alloca i32, align 4
81 %6 = alloca i32, align 4
82 store i32 1, i32* %1, align 4
83 store i32 2, i32* %2, align 4
84 store i32 3, i32* %3, align 4
85 store i32 4, i32* %4, align 4
86 store i32 5, i32* %5, align 4
87 store i32 6, i32* %6, align 4
93 ; CHECK-NEXT: [[OUTLINED]]:
95 ; CHECK-NEXT: str w8, [sp, #28]
96 ; CHECK-NEXT: mov w8, #2
97 ; CHECK-NEXT: str w8, [sp, #24]
98 ; CHECK-NEXT: mov w8, #3
99 ; CHECK-NEXT: str w8, [sp, #20]
100 ; CHECK-NEXT: mov w8, #4
101 ; CHECK-NEXT: str w8, [sp, #16]
102 ; CHECK-NEXT: mov w8, #5
103 ; CHECK-NEXT: str w8, [sp, #12]
104 ; CHECK-NEXT: mov w8, #6
105 ; CHECK-NEXT: str w8, [sp, #8]
106 ; CHECK-NEXT: add sp, sp, #32
109 attributes #0 = { noredzone "target-cpu"="cyclone" "target-features"="+sse" }