1 # RUN: llc -mtriple=aarch64--- -run-pass=machine-outliner \
2 # RUN: -verify-machineinstrs %s -o - | FileCheck %s
4 # Ensure that we can outline candidates with compatible call/frame classes.
6 # - Save/restores that don't impact the stack can be outlined together.
7 # - Save/restores that impact the stack if the outlined sequence doesn't use
11 define void @no-save1() #0 { ret void }
12 define void @no-save2() #0 { ret void }
13 define void @reg-save() #0 { ret void }
14 define void @stack-save() #0 { ret void }
15 attributes #0 = { minsize noinline noredzone "frame-pointer"="all" }
20 tracksRegLiveness: true
26 ; CHECK-LABEL: name: no-save1
27 ; CHECK: BL [[FN:@OUTLINED_FUNCTION_[0-9]+]]
42 tracksRegLiveness: true
48 ; CHECK-LABEL: name: no-save2
63 tracksRegLiveness: true
70 ; CHECK-LABEL: name: reg-save
71 ; CHECK: $[[REG:x[0-9]+]] = ORRXrs $xzr, $lr, 0
72 ; CHECK-NEXT: BL [[FN]]
73 ; CHECK-NEXT: $lr = ORRXrs $xzr, $[[REG]], 0
86 tracksRegLiveness: true
89 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x18, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp
92 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x18, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp
93 ; CHECK-LABEL: name: stack-save
94 ; CHECK: $sp = STRXpre $lr, $sp, -16
95 ; CHECK-NEXT: BL [[FN]]
96 ; CHECK-NEXT: $sp, $lr = LDRXpost $sp, 16
100 $w11 = ORRWri $wzr, 1
102 liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x18, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp