1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2 ; RUN: llc < %s -enable-machine-outliner -verify-machineinstrs | FileCheck %s 3 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" 6 7 declare i32 @thunk_called_fn(i32, i32, i32, i32) 8 9 define i32 @a() { 10 ; CHECK-LABEL: a: 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_0 16 ; CHECK-NEXT: add w0, w0, #8 // =8 17 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload 18 ; CHECK-NEXT: ret 19 entry: 20 %call = tail call i32 @thunk_called_fn(i32 1, i32 2, i32 3, i32 4) 21 %cx = add i32 %call, 8 22 ret i32 %cx 23 } 24 25 define i32 @b() { 26 ; CHECK-LABEL: b: 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_0 32 ; CHECK-NEXT: add w0, w0, #88 // =88 33 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload 34 ; CHECK-NEXT: ret 35 entry: 36 %call = tail call i32 @thunk_called_fn(i32 1, i32 2, i32 3, i32 4) 37 %cx = add i32 %call, 88 38 ret i32 %cx 39 } 40 41 ; CHECK-LABEL: OUTLINED_FUNCTION_0: 42 ; CHECK: // %bb.0: 43 ; CHECK-NEXT: orr w0, wzr, #0x1 44 ; CHECK-NEXT: orr w1, wzr, #0x2 45 ; CHECK-NEXT: orr w2, wzr, #0x3 46 ; CHECK-NEXT: orr w3, wzr, #0x4 47 ; CHECK-NEXT: b thunk_called_fn 48