1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -run-pass=machine-outliner %s -o - | FileCheck %s
5 target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
6 target triple = "thumbv8.1m.main-arm-none-eabi"
8 @__stack_chk_guard = external dso_local global ptr
10 define hidden void @test1(i32 %P0, i32 %P1) {
14 define hidden void @test2(ptr %agg.result) { ret void }
15 define hidden void @test3(ptr %agg.result) { ret void }
16 define hidden void @test4(ptr %agg.result) { ret void }
18 declare void @noreturn(ptr, ptr, ptr) noreturn
23 tracksRegLiveness: true
25 - { id: 1, name: '', type: spill-slot, offset: -12, size: 4, alignment: 4,
26 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
27 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
30 debugValueSubstitutions: []
35 ; CHECK-LABEL: name: test1
37 ; CHECK-NEXT: successors: %bb.1(0x80000000)
38 ; CHECK-NEXT: liveins: $lr, $r0, $r1, $r2, $r3, $r4
40 ; CHECK-NEXT: early-clobber $sp = t2STR_PRE killed $lr, $sp, -8, 14 /* CC::al */, $noreg
41 ; CHECK-NEXT: tBL 14 /* CC::al */, $noreg, @OUTLINED_FUNCTION_0, implicit-def $lr, implicit $sp, implicit-def $lr, implicit-def $sp, implicit-def $r1, implicit $noreg, implicit $sp
42 ; CHECK-NEXT: $lr, $sp = t2LDR_POST $sp, 8, 14 /* CC::al */, $noreg
43 ; CHECK-NEXT: tCMPi8 killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
44 ; CHECK-NEXT: t2STRDi8 killed $r2, killed $r3, $sp, 16, 14 /* CC::al */, $noreg
45 ; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */, 327689 /* reguse:GPR */, killed renamable $lr
48 ; CHECK-NEXT: successors: %bb.2(0x80000000)
49 ; CHECK-NEXT: liveins: $r4
52 ; CHECK-NEXT: tBL 14 /* CC::al */, $noreg, @noreturn, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit undef $r0, implicit undef $r1, implicit undef $r2, implicit-def $sp
54 liveins: $lr, $r0, $r1, $r2, $r3, $r4
56 $r1 = t2MOVi16 target-flags(arm-lo16) @__stack_chk_guard, 14 /* CC::al */, $noreg
57 $r1 = t2MOVTi16 killed $r1, target-flags(arm-hi16) @__stack_chk_guard, 14 /* CC::al */, $noreg
59 tCMPi8 killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
60 t2STRDi8 killed $r2, killed $r3, $sp, 16, 14 /* CC::al */, $noreg
61 INLINEASM &"", 1 /* sideeffect attdialect */, 327689 /* reguse:GPR */, killed renamable $lr
67 tBL 14 /* CC::al */, $noreg, @noreturn, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit undef $r0, implicit undef $r1, implicit undef $r2, implicit-def $sp
72 tracksRegLiveness: true
75 ; CHECK-LABEL: name: test2
76 ; CHECK: tBL 14 /* CC::al */, $noreg, @OUTLINED_FUNCTION_0, implicit-def $lr, implicit $sp, implicit-def $r1, implicit-def $lr, implicit $noreg, implicit $sp
77 $r1 = t2MOVi16 target-flags(arm-lo16) @__stack_chk_guard, 14 /* CC::al */, $noreg
78 $r1 = t2MOVTi16 killed $r1, target-flags(arm-hi16) @__stack_chk_guard, 14 /* CC::al */, $noreg
82 tracksRegLiveness: true
85 ; CHECK-LABEL: name: test3
86 ; CHECK: tBL 14 /* CC::al */, $noreg, @OUTLINED_FUNCTION_0, implicit-def $lr, implicit $sp, implicit-def $r1, implicit-def $lr, implicit $noreg, implicit $sp
87 $r1 = t2MOVi16 target-flags(arm-lo16) @__stack_chk_guard, 14 /* CC::al */, $noreg
88 $r1 = t2MOVTi16 killed $r1, target-flags(arm-hi16) @__stack_chk_guard, 14 /* CC::al */, $noreg
92 tracksRegLiveness: true
95 ; CHECK-LABEL: name: test4
96 ; CHECK: tBL 14 /* CC::al */, $noreg, @OUTLINED_FUNCTION_0, implicit-def $lr, implicit $sp, implicit-def $r1, implicit-def $lr, implicit $noreg, implicit $sp
97 $r1 = t2MOVi16 target-flags(arm-lo16) @__stack_chk_guard, 14 /* CC::al */, $noreg
98 $r1 = t2MOVTi16 killed $r1, target-flags(arm-hi16) @__stack_chk_guard, 14 /* CC::al */, $noreg