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_DIRECT:OUTLINED_FUNCTION_[0-9]+]]
16 ; CHECK-NEXT: add w0, w0, #8 // =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_DIRECT]]
32 ; CHECK-NEXT: add w0, w0, #88 // =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(i32 (i32, i32, i32, i32)* %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_INDIRECT:OUTLINED_FUNCTION_[0-9]+]]
48 ; CHECK-NEXT: add w0, w0, #8 // =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(i32 (i32, i32, i32, i32)* %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_INDIRECT]]
64 ; CHECK-NEXT: add w0, w0, #88 // =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_INDIRECT]]:
75 ; CHECK-NEXT: mov x8, x0
76 ; CHECK-NEXT: mov w0, #1
77 ; CHECK-NEXT: mov w1, #2
78 ; CHECK-NEXT: mov w2, #3
79 ; CHECK-NEXT: mov w3, #4
82 ; CHECK: [[OUTLINED_DIRECT]]:
84 ; CHECK-NEXT: mov w0, #1
85 ; CHECK-NEXT: mov w1, #2
86 ; CHECK-NEXT: mov w2, #3
87 ; CHECK-NEXT: mov w3, #4
88 ; CHECK-NEXT: b thunk_called_fn