2 # RUN: llc -mtriple=hexagon -run-pass hexagon-cext-opt %s -o - | FileCheck %s
4 # Check that the HexagonConstantExtenders pass does not assert when block
5 # addresses from different functions are used
6 # CHECK-LABEL: name: wibble
7 # CHECK: A2_tfrsi blockaddress(@baz
8 # CHECK: A2_tfrsi blockaddress(@wibble
11 target triple = "hexagon"
13 define dso_local void @baz() {
18 %call = tail call fastcc i32 @wibble(i32 poison)
22 define internal fastcc i32 @wibble(i32 %arg) {
24 %call = tail call i32 @eggs(i32 noundef ptrtoint (ptr blockaddress(@baz, %bb1) to i32))
28 tail call void @baz.1(i32 noundef ptrtoint (ptr blockaddress(@wibble, %bb1) to i32))
32 declare i32 @eggs(i32 noundef) local_unnamed_addr
34 declare void @baz.1(i32 noundef) local_unnamed_addr
40 exposesReturnsTwice: false
42 regBankSelected: false
45 tracksRegLiveness: true
48 callsUnwindInit: false
54 failsVerification: false
55 tracksDebugUserValues: false
57 - { id: 0, class: intregs, preferred-register: '' }
60 isFrameAddressTaken: false
61 isReturnAddressTaken: false
71 maxCallFrameSize: 4294967295
72 cvBytesOfCalleeSavedRegisters: 0
73 hasOpaqueSPAdjustment: false
75 hasMustTailInVarArgFunc: false
77 isCalleeSavedInfoValid: false
85 debugValueSubstitutions: []
87 machineFunctionInfo: {}
90 successors: %bb.1(0x80000000)
92 bb.1.bb1 (ir-block-address-taken %ir-block.bb1):
93 %0:intregs = IMPLICIT_DEF
95 PS_tailcall_i @wibble, hexagoncsr, implicit $r0
101 exposesReturnsTwice: false
103 regBankSelected: false
106 tracksRegLiveness: true
109 callsUnwindInit: false
115 failsVerification: false
116 tracksDebugUserValues: false
118 - { id: 0, class: intregs, preferred-register: '' }
119 - { id: 1, class: intregs, preferred-register: '' }
120 - { id: 2, class: intregs, preferred-register: '' }
121 - { id: 3, class: intregs, preferred-register: '' }
122 - { id: 4, class: intregs, preferred-register: '' }
125 isFrameAddressTaken: false
126 isReturnAddressTaken: false
136 maxCallFrameSize: 4294967295
137 cvBytesOfCalleeSavedRegisters: 0
138 hasOpaqueSPAdjustment: false
140 hasMustTailInVarArgFunc: false
142 isCalleeSavedInfoValid: false
150 debugValueSubstitutions: []
152 machineFunctionInfo: {}
155 successors: %bb.1(0x80000000)
157 %2:intregs = A2_tfrsi blockaddress(@baz, %ir-block.bb1)
158 ADJCALLSTACKDOWN 0, 0, implicit-def $r29, implicit-def dead $r30, implicit $r31, implicit $r30, implicit $r29
160 J2_call @eggs, hexagoncsr, implicit-def dead $pc, implicit-def dead $r31, implicit $r29, implicit $r0, implicit-def $r29, implicit-def $r0
161 ADJCALLSTACKUP 0, 0, implicit-def dead $r29, implicit-def dead $r30, implicit-def dead $r31, implicit $r29
162 %3:intregs = COPY $r0
164 bb.1.bb1 (ir-block-address-taken %ir-block.bb1):
165 %4:intregs = A2_tfrsi blockaddress(@wibble, %ir-block.bb1)
166 ADJCALLSTACKDOWN 0, 0, implicit-def $r29, implicit-def dead $r30, implicit $r31, implicit $r30, implicit $r29
168 J2_call @baz.1, hexagoncsr, implicit-def dead $pc, implicit-def dead $r31, implicit $r29, implicit $r0, implicit-def $r29
169 ADJCALLSTACKUP 0, 0, implicit-def dead $r29, implicit-def dead $r30, implicit-def dead $r31, implicit $r29
171 PS_jmpret $r31, implicit-def dead $pc, implicit $r0