1 # RUN: llc --run-pass=arm-branch-targets %s -o - | FileCheck %s
3 target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
4 target triple = "thumbv8.1m.main-arm-unknown-eabi"
6 define hidden i32 @_Z1fi(i32 %x) {
8 %add = add nsw i32 %x, 1
9 %call = tail call i32 @_Z1gi(i32 %add)
10 %sub = add nsw i32 %call, -1
14 declare dso_local i32 @_Z1gi(i32)
16 !llvm.module.flags = !{!0, !1, !2}
18 !0 = !{i32 8, !"branch-target-enforcement", i32 1}
19 !1 = !{i32 8, !"sign-return-address", i32 1}
20 !2 = !{i32 8, !"sign-return-address-all", i32 0}
26 exposesReturnsTwice: false
28 regBankSelected: false
31 tracksRegLiveness: true
35 - { reg: '$r0', virtual-reg: '' }
37 isFrameAddressTaken: false
38 isReturnAddressTaken: false
48 cvBytesOfCalleeSavedRegisters: 0
49 hasOpaqueSPAdjustment: false
51 hasMustTailInVarArgFunc: false
57 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
58 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
59 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
60 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
61 stack-id: default, callee-saved-register: '$r7', callee-saved-restored: true,
62 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
63 - { id: 2, name: '', type: spill-slot, offset: -12, size: 4, alignment: 4,
64 stack-id: default, callee-saved-register: '$r12', callee-saved-restored: true,
65 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
67 debugValueSubstitutions: []
69 machineFunctionInfo: {}
72 liveins: $r0, $r7, $lr, $r12
74 frame-setup t2PAC implicit-def $r12, implicit $lr, implicit $sp
75 frame-setup tPUSH 14 /* CC::al */, $noreg, killed $r7, killed $lr, implicit-def $sp, implicit $sp
76 frame-setup CFI_INSTRUCTION def_cfa_offset 8
77 frame-setup CFI_INSTRUCTION offset $lr, -4
78 frame-setup CFI_INSTRUCTION offset $r7, -8
79 early-clobber $sp = frame-setup t2STR_PRE killed $r12, $sp, -4, 14 /* CC::al */, $noreg
80 frame-setup CFI_INSTRUCTION def_cfa_offset 12
81 frame-setup CFI_INSTRUCTION offset $ra_auth_code, -12
82 $sp = frame-setup tSUBspi $sp, 1, 14 /* CC::al */, $noreg
83 frame-setup CFI_INSTRUCTION def_cfa_offset 16
84 renamable $r0, dead $cpsr = nsw tADDi8 killed renamable $r0, 1, 14 /* CC::al */, $noreg
85 tBL 14 /* CC::al */, $noreg, @_Z1gi, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit-def $sp, implicit-def $r0
86 renamable $r0, dead $cpsr = nsw tSUBi8 killed renamable $r0, 1, 14 /* CC::al */, $noreg
87 $sp = frame-destroy tADDspi $sp, 1, 14 /* CC::al */, $noreg
88 $r12, $sp = frame-destroy t2LDR_POST $sp, 4, 14 /* CC::al */, $noreg
89 $sp = frame-destroy t2LDMIA_UPD $sp, 14 /* CC::al */, $noreg, def $r7, def $lr
90 t2AUT implicit $r12, implicit $lr, implicit $sp
91 tBX_RET 14 /* CC::al */, $noreg, implicit killed $r0
94 # Check PAC is replaces with PACBTI and it has the frame-setup flag
95 # CHECK-LABEL: bb.0.entry:
96 # CHECK: frame-setup t2PACBTI