1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -enable-machine-outliner -verify-machineinstrs | FileCheck %s
4 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
5 target triple = "aarch64-pc-linux-gnu"
7 declare i32 @thunk_called_fn(i32, i32, i32, i32)
11 ; CHECK: // %bb.0: // %entry
12 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
13 ; CHECK-NEXT: .cfi_def_cfa_offset 16
14 ; CHECK-NEXT: .cfi_offset w30, -16
15 ; CHECK-NEXT: bl OUTLINED_FUNCTION_1
16 ; CHECK-NEXT: add w0, w0, #8
17 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
20 %call = tail call i32 @thunk_called_fn(i32 1, i32 2, i32 3, i32 4)
21 %cx = add i32 %call, 8
27 ; CHECK: // %bb.0: // %entry
28 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
29 ; CHECK-NEXT: .cfi_def_cfa_offset 16
30 ; CHECK-NEXT: .cfi_offset w30, -16
31 ; CHECK-NEXT: bl OUTLINED_FUNCTION_1
32 ; CHECK-NEXT: add w0, w0, #88
33 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
36 %call = tail call i32 @thunk_called_fn(i32 1, i32 2, i32 3, i32 4)
37 %cx = add i32 %call, 88
41 define hidden i32 @c(ptr %fptr) {
43 ; CHECK: // %bb.0: // %entry
44 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
45 ; CHECK-NEXT: .cfi_def_cfa_offset 16
46 ; CHECK-NEXT: .cfi_offset w30, -16
47 ; CHECK-NEXT: bl OUTLINED_FUNCTION_0
48 ; CHECK-NEXT: add w0, w0, #8
49 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
52 %call = tail call i32 %fptr(i32 1, i32 2, i32 3, i32 4)
53 %add = add nsw i32 %call, 8
57 define hidden i32 @d(ptr %fptr) {
59 ; CHECK: // %bb.0: // %entry
60 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
61 ; CHECK-NEXT: .cfi_def_cfa_offset 16
62 ; CHECK-NEXT: .cfi_offset w30, -16
63 ; CHECK-NEXT: bl OUTLINED_FUNCTION_0
64 ; CHECK-NEXT: add w0, w0, #88
65 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
68 %call = tail call i32 %fptr(i32 1, i32 2, i32 3, i32 4)
69 %add = add nsw i32 %call, 88
73 ; CHECK: OUTLINED_FUNCTION_0:
74 ; CHECK-SAME: // @OUTLINED_FUNCTION_0 Thunk
76 ; CHECK-NEXT: mov x8, x0
77 ; CHECK-NEXT: mov w0, #1
78 ; CHECK-NEXT: mov w1, #2
79 ; CHECK-NEXT: mov w2, #3
80 ; CHECK-NEXT: mov w3, #4
83 ; CHECK: OUTLINED_FUNCTION_1:
84 ; CHECK-SAME: // @OUTLINED_FUNCTION_1 Thunk
86 ; CHECK-NEXT: mov w0, #1
87 ; CHECK-NEXT: mov w1, #2
88 ; CHECK-NEXT: mov w2, #3
89 ; CHECK-NEXT: mov w3, #4
90 ; CHECK-NEXT: b thunk_called_fn