|
| 1 | +# RUN: llc -o - -run-pass=machine-scheduler -misched=shuffle %s | FileCheck %s |
| 2 | +# RUN: llc -o - -run-pass=postmisched %s | FileCheck %s |
| 3 | + |
| 4 | +--- | |
| 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" |
| 7 | + |
| 8 | + define i32 @foo_bti(i32 %a) #1 { |
| 9 | + entry: |
| 10 | + %add = add nsw i32 %a, 1 |
| 11 | + ret i32 %add |
| 12 | + } |
| 13 | + |
| 14 | + define i32 @foo_pacbti(i32 %a) #1 { |
| 15 | + entry: |
| 16 | + %add = add nsw i32 %a, 1 |
| 17 | + ret i32 %add |
| 18 | + } |
| 19 | + |
| 20 | + define i32 @foo_setjmp() #0 { |
| 21 | + entry: |
| 22 | + %buf = alloca [20 x i64], align 8 |
| 23 | + %call = call i32 @setjmp(ptr noundef nonnull %buf) #4 |
| 24 | + %tobool.not = icmp eq i32 %call, 0 |
| 25 | + br i1 %tobool.not, label %if.else, label %if.then |
| 26 | + |
| 27 | + if.then: ; preds = %entry |
| 28 | + call void @longjmp(ptr noundef nonnull %buf, i32 noundef 1) #5 |
| 29 | + unreachable |
| 30 | + |
| 31 | + if.else: ; preds = %entry |
| 32 | + ret i32 0 |
| 33 | + } |
| 34 | + |
| 35 | + declare i32 @setjmp(ptr noundef) #2 |
| 36 | + declare void @longjmp(ptr noundef, i32 noundef) #3 |
| 37 | + |
| 38 | + attributes #0 = { "frame-pointer"="all" "target-cpu"="cortex-m55" "target-features"="+armv8.1-m.main" } |
| 39 | + attributes #1 = { "frame-pointer"="all" "target-cpu"="cortex-m55" "target-features"="+armv8.1-m.main" } |
| 40 | + attributes #2 = { nounwind returns_twice "frame-pointer"="all" "target-cpu"="cortex-m55" "target-features"="+armv8.1-m.main" } |
| 41 | + attributes #3 = { noreturn nounwind "frame-pointer"="all" "target-cpu"="cortex-m55" "target-features"="+armv8.1-m.main" } |
| 42 | + attributes #4 = { nounwind returns_twice } |
| 43 | + attributes #5 = { noreturn nounwind } |
| 44 | + |
| 45 | +... |
| 46 | +--- |
| 47 | +name: foo_bti |
| 48 | +tracksRegLiveness: true |
| 49 | +body: | |
| 50 | + bb.0.entry: |
| 51 | + liveins: $r0 |
| 52 | +
|
| 53 | + t2BTI |
| 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 |
| 56 | +
|
| 57 | +... |
| 58 | + |
| 59 | +# CHECK-LABEL: name: foo_bti |
| 60 | +# CHECK: body: |
| 61 | +# CHECK-NEXT: bb.0.entry: |
| 62 | +# CHECK-NEXT: liveins: $r0 |
| 63 | +# CHECK-NEXT: {{^ +$}} |
| 64 | +# CHECK-NEXT: t2BTI |
| 65 | + |
| 66 | +--- |
| 67 | +name: foo_pacbti |
| 68 | +tracksRegLiveness: true |
| 69 | +body: | |
| 70 | + bb.0.entry: |
| 71 | + liveins: $r0, $lr, $r12 |
| 72 | +
|
| 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 | + renamable $r0 = nsw t2ADDri killed renamable $r0, 1, 14 /* CC::al */, $noreg, $noreg |
| 79 | + $r12, $sp = frame-destroy t2LDR_POST $sp, 4, 14 /* CC::al */, $noreg |
| 80 | + $sp = frame-destroy t2LDMIA_UPD $sp, 14 /* CC::al */, $noreg, def $r7, def $lr |
| 81 | + t2AUT implicit $r12, implicit $lr, implicit $sp |
| 82 | + tBX_RET 14 /* CC::al */, $noreg, implicit $r0 |
| 83 | +
|
| 84 | +... |
| 85 | + |
| 86 | +# CHECK-LABEL: name: foo_pacbti |
| 87 | +# CHECK: body: |
| 88 | +# CHECK-NEXT: bb.0.entry: |
| 89 | +# CHECK-NEXT: liveins: $r0, $lr, $r12 |
| 90 | +# CHECK-NEXT: {{^ +$}} |
| 91 | +# CHECK-NEXT: frame-setup t2PAC implicit-def $r12, implicit $lr, implicit $sp |
| 92 | + |
| 93 | +--- |
| 94 | +name: foo_setjmp |
| 95 | +tracksRegLiveness: true |
| 96 | +body: | |
| 97 | + bb.0.entry: |
| 98 | + successors: %bb.1 |
| 99 | + liveins: $lr |
| 100 | +
|
| 101 | + frame-setup tPUSH 14 /* CC::al */, $noreg, $r7, killed $lr, implicit-def $sp, implicit $sp |
| 102 | + $r7 = frame-setup tMOVr $sp, 14 /* CC::al */, $noreg |
| 103 | + $sp = frame-setup tSUBspi $sp, 40, 14 /* CC::al */, $noreg |
| 104 | + renamable $r0 = tMOVr $sp, 14 /* CC::al */, $noreg |
| 105 | + tBL 14 /* CC::al */, $noreg, @setjmp, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit-def $sp, implicit-def $r0 |
| 106 | + t2BTI |
| 107 | + renamable $r2 = nsw t2ADDri $r0, 3, 14 /* CC::al */, $noreg, $noreg |
| 108 | + tCMPi8 killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr |
| 109 | + t2IT 0, 2, implicit-def $itstate |
| 110 | + renamable $r0 = tMOVi8 $noreg, 0, 0 /* CC::eq */, $cpsr, implicit $itstate |
| 111 | + $sp = frame-destroy tADDspi $sp, 40, 0 /* CC::eq */, $cpsr, implicit $itstate |
| 112 | + frame-destroy tPOP_RET 0 /* CC::eq */, killed $cpsr, def $r7, def $pc, implicit killed $r0, implicit $sp, implicit killed $itstate |
| 113 | +
|
| 114 | + bb.1.if.then: |
| 115 | + renamable $r0 = tMOVr $sp, 14 /* CC::al */, $noreg |
| 116 | + renamable $r1, dead $cpsr = tMOVi8 1, 14 /* CC::al */, $noreg |
| 117 | + tBL 14 /* CC::al */, $noreg, @longjmp, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit killed $r1, implicit-def $sp |
| 118 | +
|
| 119 | +... |
| 120 | + |
| 121 | +# CHECK-LABEL: name: foo_setjmp |
| 122 | +# CHECK: body: |
| 123 | +# CHECK: tBL 14 /* CC::al */, $noreg, @setjmp, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit-def $sp, implicit-def $r0 |
| 124 | +# CHECK-NEXT: t2BTI |
0 commit comments