1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=mips-img-linux-gnu -mcpu=mips32r6 %s -o - -start-before mips-delay-slot-filler -stop-after mips-branch-expansion | FileCheck %s --check-prefix=R6
3 # RUN: llc -mtriple=mips-img-linux-gnu -mcpu=mips32r6 %s -o - -start-before mips-delay-slot-filler -stop-after mips-branch-expansion -relocation-model=pic | FileCheck %s --check-prefix=PIC
5 # Test the long branch expansion of various branches
9 define i32 @a(double %a, double %b) {
11 %cmp = fcmp une double %a, %b
12 br i1 %cmp, label %if.then, label %return
14 if.then: ; preds = %entry
15 call void asm sideeffect ".space 310680", "~{$1}"()
18 return: ; preds = %entry
22 define i32 @b(double %a, double %b) {
24 %cmp = fcmp ueq double %a, %b
25 br i1 %cmp, label %if.then, label %return
27 if.then: ; preds = %entry
28 call void asm sideeffect ".space 310680", "~{$1}"()
31 return: ; preds = %entry
40 exposesReturnsTwice: false
42 regBankSelected: false
45 tracksRegLiveness: true
48 - { reg: '$d12_64', virtual-reg: '' }
49 - { reg: '$d14_64', virtual-reg: '' }
51 isFrameAddressTaken: false
52 isReturnAddressTaken: false
62 hasOpaqueSPAdjustment: false
64 hasMustTailInVarArgFunc: false
74 ; R6: successors: %bb.2(0x50000000), %bb.1(0x30000000)
75 ; R6: $f0 = CMP_EQ_D killed $d12_64, killed $d14_64
76 ; R6: BC1NEZ $d0_64, %bb.2 {
80 ; R6: successors: %bb.3(0x80000000)
83 ; R6: INLINEASM &".space 310680", 1, 12, implicit-def dead early-clobber $at
84 ; R6: PseudoReturn undef $ra, implicit killed $v0 {
85 ; R6: $v0 = ADDiu $zero, 0
88 ; R6: PseudoReturn undef $ra, implicit killed $v0 {
89 ; R6: $v0 = ADDiu $zero, 1
93 ; PIC: successors: %bb.3(0x50000000), %bb.1(0x30000000)
94 ; PIC: $f0 = CMP_EQ_D killed $d12_64, killed $d14_64
95 ; PIC: BC1NEZ $d0_64, %bb.3 {
99 ; PIC: successors: %bb.2(0x80000000)
100 ; PIC: $sp = ADDiu $sp, -8
101 ; PIC: SW $ra, $sp, 0
102 ; PIC: $at = LONG_BRANCH_LUi target-flags(mips-abs-hi) %bb.4, %bb.2
103 ; PIC: $at = LONG_BRANCH_ADDiu $at, target-flags(mips-abs-lo) %bb.4, %bb.2
104 ; PIC: BALC %bb.2, implicit-def $ra
106 ; PIC: successors: %bb.4(0x80000000)
107 ; PIC: $at = ADDu $ra, $at
108 ; PIC: $ra = LW $sp, 0
109 ; PIC: $sp = ADDiu $sp, 8
110 ; PIC: JIC $at, 0, implicit-def $at
112 ; PIC: INLINEASM &".space 310680", 1, 12, implicit-def dead early-clobber $at
113 ; PIC: PseudoReturn undef $ra, implicit killed $v0 {
114 ; PIC: $v0 = ADDiu $zero, 0
117 ; PIC: PseudoReturn undef $ra, implicit killed $v0 {
118 ; PIC: $v0 = ADDiu $zero, 1
121 successors: %bb.1(0x50000000), %bb.2(0x30000000)
122 liveins: $d12_64, $d14_64
124 $f0 = CMP_EQ_D killed $d12_64, killed $d14_64
125 BC1EQZ killed $d0_64, %bb.2, implicit-def $at
128 INLINEASM &".space 310680", 1, 12, implicit-def dead early-clobber $at
130 PseudoReturn undef $ra, implicit killed $v0
134 PseudoReturn undef $ra, implicit killed $v0
140 exposesReturnsTwice: false
142 regBankSelected: false
145 tracksRegLiveness: true
148 - { reg: '$d12_64', virtual-reg: '' }
149 - { reg: '$d14_64', virtual-reg: '' }
151 isFrameAddressTaken: false
152 isReturnAddressTaken: false
162 hasOpaqueSPAdjustment: false
164 hasMustTailInVarArgFunc: false
174 ; R6: successors: %bb.2(0x50000000), %bb.1(0x30000000)
175 ; R6: $f0 = CMP_EQ_D killed $d12_64, killed $d14_64
176 ; R6: BC1EQZ $d0_64, %bb.2 {
180 ; R6: successors: %bb.3(0x80000000)
183 ; R6: INLINEASM &".space 310680", 1, 12, implicit-def dead early-clobber $at
184 ; R6: PseudoReturn undef $ra, implicit killed $v0 {
185 ; R6: $v0 = ADDiu $zero, 0
188 ; R6: PseudoReturn undef $ra, implicit killed $v0 {
189 ; R6: $v0 = ADDiu $zero, 1
193 ; PIC: successors: %bb.3(0x50000000), %bb.1(0x30000000)
194 ; PIC: $f0 = CMP_EQ_D killed $d12_64, killed $d14_64
195 ; PIC: BC1EQZ $d0_64, %bb.3 {
199 ; PIC: successors: %bb.2(0x80000000)
200 ; PIC: $sp = ADDiu $sp, -8
201 ; PIC: SW $ra, $sp, 0
202 ; PIC: $at = LONG_BRANCH_LUi target-flags(mips-abs-hi) %bb.4, %bb.2
203 ; PIC: $at = LONG_BRANCH_ADDiu $at, target-flags(mips-abs-lo) %bb.4, %bb.2
204 ; PIC: BALC %bb.2, implicit-def $ra
206 ; PIC: successors: %bb.4(0x80000000)
207 ; PIC: $at = ADDu $ra, $at
208 ; PIC: $ra = LW $sp, 0
209 ; PIC: $sp = ADDiu $sp, 8
210 ; PIC: JIC $at, 0, implicit-def $at
212 ; PIC: INLINEASM &".space 310680", 1, 12, implicit-def dead early-clobber $at
213 ; PIC: PseudoReturn undef $ra, implicit killed $v0 {
214 ; PIC: $v0 = ADDiu $zero, 0
217 ; PIC: PseudoReturn undef $ra, implicit killed $v0 {
218 ; PIC: $v0 = ADDiu $zero, 1
221 successors: %bb.1(0x50000000), %bb.2(0x30000000)
222 liveins: $d12_64, $d14_64
224 $f0 = CMP_EQ_D killed $d12_64, killed $d14_64
225 BC1NEZ killed $d0_64, %bb.2, implicit-def $at
228 INLINEASM &".space 310680", 1, 12, implicit-def dead early-clobber $at
230 PseudoReturn undef $ra, implicit killed $v0
234 PseudoReturn undef $ra, implicit killed $v0