1 # RUN: llc -o - -run-pass=machine-scheduler -misched=shuffle %s | FileCheck %s
2 # RUN: llc -o - -run-pass=postmisched %s | FileCheck %s
5 # -misched=shuffle is only available with assertions enabled
8 target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
9 target triple = "thumbv8.1m.main-arm-none-eabi"
11 define i32 @foo_bti() #0 {
16 define i32 @foo_pac() #0 {
21 define i32 @foo_pacbti() #0 {
26 define i32 @foo_setjmp() #0 {
33 define i32 @foo_sg() #0 {
38 declare i32 @setjmp(ptr noundef) #1
39 declare void @longjmp(ptr noundef, i32 noundef) #2
41 attributes #0 = { "frame-pointer"="all" "target-cpu"="cortex-m55" "target-features"="+armv8.1-m.main" }
42 attributes #1 = { nounwind returns_twice "frame-pointer"="all" "target-cpu"="cortex-m55" "target-features"="+armv8.1-m.main" }
43 attributes #2 = { noreturn nounwind "frame-pointer"="all" "target-cpu"="cortex-m55" "target-features"="+armv8.1-m.main" }
48 tracksRegLiveness: true
54 renamable $r0, dead $cpsr = nsw tADDi8 killed renamable $r0, 1, 14 /* CC::al */, $noreg
55 tBX_RET 14 /* CC::al */, $noreg, implicit killed $r0
59 # CHECK-LABEL: name: foo_bti
61 # CHECK-NEXT: bb.0.entry:
62 # CHECK-NEXT: liveins: $r0
63 # CHECK-NEXT: {{^ +$}}
68 tracksRegLiveness: true
71 liveins: $r0, $lr, $r12
73 frame-setup t2PAC implicit-def $r12, implicit $lr, implicit $sp
74 renamable $r2 = nsw t2ADDri $r0, 3, 14 /* CC::al */, $noreg, $noreg
75 $sp = frame-setup t2STMDB_UPD $sp, 14 /* CC::al */, $noreg, killed $r7, killed $lr
76 $r7 = frame-setup tMOVr killed $sp, 14 /* CC::al */, $noreg
77 early-clobber $sp = frame-setup t2STR_PRE killed $r12, $sp, -4, 14 /* CC::al */, $noreg
78 $r12, $sp = frame-destroy t2LDR_POST $sp, 4, 14 /* CC::al */, $noreg
79 $sp = frame-destroy t2LDMIA_UPD $sp, 14 /* CC::al */, $noreg, def $r7, def $lr
80 t2AUT implicit $r12, implicit $lr, implicit $sp
81 tBX_RET 14 /* CC::al */, $noreg, implicit $r0
85 # CHECK-LABEL: name: foo_pac
87 # CHECK-NEXT: bb.0.entry:
88 # CHECK-NEXT: liveins: $r0, $lr, $r12
89 # CHECK-NEXT: {{^ +$}}
90 # CHECK-NEXT: frame-setup t2PAC implicit-def $r12, implicit $lr, implicit $sp
94 tracksRegLiveness: true
97 liveins: $r0, $lr, $r12
99 frame-setup t2PACBTI implicit-def $r12, implicit $lr, implicit $sp
100 renamable $r2 = nsw t2ADDri $r0, 3, 14 /* CC::al */, $noreg, $noreg
101 $sp = frame-setup t2STMDB_UPD $sp, 14 /* CC::al */, $noreg, killed $r7, killed $lr
102 $r7 = frame-setup tMOVr killed $sp, 14 /* CC::al */, $noreg
103 early-clobber $sp = frame-setup t2STR_PRE killed $r12, $sp, -4, 14 /* CC::al */, $noreg
104 $r12, $sp = frame-destroy t2LDR_POST $sp, 4, 14 /* CC::al */, $noreg
105 $sp = frame-destroy t2LDMIA_UPD $sp, 14 /* CC::al */, $noreg, def $r7, def $lr
106 t2AUT implicit $r12, implicit $lr, implicit $sp
107 tBX_RET 14 /* CC::al */, $noreg, implicit $r0
111 # CHECK-LABEL: name: foo_pacbti
113 # CHECK-NEXT: bb.0.entry:
114 # CHECK-NEXT: liveins: $r0, $lr, $r12
115 # CHECK-NEXT: {{^ +$}}
116 # CHECK-NEXT: frame-setup t2PACBTI implicit-def $r12, implicit $lr, implicit $sp
120 tracksRegLiveness: true
126 frame-setup tPUSH 14 /* CC::al */, $noreg, $r7, killed $lr, implicit-def $sp, implicit $sp
127 $r7 = frame-setup tMOVr $sp, 14 /* CC::al */, $noreg
128 $sp = frame-setup tSUBspi $sp, 40, 14 /* CC::al */, $noreg
129 renamable $r0 = tMOVr $sp, 14 /* CC::al */, $noreg
130 tBL 14 /* CC::al */, $noreg, @setjmp, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit-def $sp, implicit-def $r0
132 renamable $r2 = nsw t2ADDri $r0, 3, 14 /* CC::al */, $noreg, $noreg
133 tCMPi8 killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
134 t2IT 0, 2, implicit-def $itstate
135 renamable $r0 = tMOVi8 $noreg, 0, 0 /* CC::eq */, $cpsr, implicit $itstate
136 $sp = frame-destroy tADDspi $sp, 40, 0 /* CC::eq */, $cpsr, implicit $itstate
137 frame-destroy tPOP_RET 0 /* CC::eq */, killed $cpsr, def $r7, def $pc, implicit killed $r0, implicit $sp, implicit killed $itstate
140 renamable $r0 = tMOVr $sp, 14 /* CC::al */, $noreg
141 renamable $r1, dead $cpsr = tMOVi8 1, 14 /* CC::al */, $noreg
142 tBL 14 /* CC::al */, $noreg, @longjmp, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit killed $r1, implicit-def $sp
146 # CHECK-LABEL: name: foo_setjmp
148 # CHECK: tBL 14 /* CC::al */, $noreg, @setjmp, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit-def $sp, implicit-def $r0
153 tracksRegLiveness: true
158 t2SG 14 /* CC::al */, $noreg
159 renamable $r0, dead $cpsr = nsw tADDi8 killed renamable $r0, 1, 14 /* CC::al */, $noreg
160 tBX_RET 14 /* CC::al */, $noreg, implicit killed $r0
164 # CHECK-LABEL: name: foo_sg
166 # CHECK-NEXT: bb.0.entry:
167 # CHECK-NEXT: liveins: $r0
168 # CHECK-NEXT: {{^ +$}}