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) "sign-return-address"="non-leaf" "sign-return-address-key"="a_key" "branch-target-enforcement" {
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)
20 exposesReturnsTwice: false
22 regBankSelected: false
25 tracksRegLiveness: true
29 - { reg: '$r0', virtual-reg: '' }
31 isFrameAddressTaken: false
32 isReturnAddressTaken: false
42 cvBytesOfCalleeSavedRegisters: 0
43 hasOpaqueSPAdjustment: false
45 hasMustTailInVarArgFunc: false
51 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
52 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
53 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
54 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
55 stack-id: default, callee-saved-register: '$r7', callee-saved-restored: true,
56 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
57 - { id: 2, name: '', type: spill-slot, offset: -12, size: 4, alignment: 4,
58 stack-id: default, callee-saved-register: '$r12', callee-saved-restored: true,
59 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
61 debugValueSubstitutions: []
63 machineFunctionInfo: {}
66 liveins: $r0, $r7, $lr, $r12
68 frame-setup t2PAC implicit-def $r12, implicit $lr, implicit $sp
69 frame-setup tPUSH 14 /* CC::al */, $noreg, killed $r7, killed $lr, implicit-def $sp, implicit $sp
70 frame-setup CFI_INSTRUCTION def_cfa_offset 8
71 frame-setup CFI_INSTRUCTION offset $lr, -4
72 frame-setup CFI_INSTRUCTION offset $r7, -8
73 early-clobber $sp = frame-setup t2STR_PRE killed $r12, $sp, -4, 14 /* CC::al */, $noreg
74 frame-setup CFI_INSTRUCTION def_cfa_offset 12
75 frame-setup CFI_INSTRUCTION offset $ra_auth_code, -12
76 $sp = frame-setup tSUBspi $sp, 1, 14 /* CC::al */, $noreg
77 frame-setup CFI_INSTRUCTION def_cfa_offset 16
78 renamable $r0, dead $cpsr = nsw tADDi8 killed renamable $r0, 1, 14 /* CC::al */, $noreg
79 tBL 14 /* CC::al */, $noreg, @_Z1gi, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit-def $sp, implicit-def $r0
80 renamable $r0, dead $cpsr = nsw tSUBi8 killed renamable $r0, 1, 14 /* CC::al */, $noreg
81 $sp = frame-destroy tADDspi $sp, 1, 14 /* CC::al */, $noreg
82 $r12, $sp = frame-destroy t2LDR_POST $sp, 4, 14 /* CC::al */, $noreg
83 $sp = frame-destroy t2LDMIA_UPD $sp, 14 /* CC::al */, $noreg, def $r7, def $lr
84 t2AUT implicit $r12, implicit $lr, implicit $sp
85 tBX_RET 14 /* CC::al */, $noreg, implicit killed $r0
88 # Check PAC is replaces with PACBTI and it has the frame-setup flag
89 # CHECK-LABEL: bb.0.entry:
90 # CHECK: frame-setup t2PACBTI