1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=mips-mti-linux-gnu %s -o - -start-before mips-delay-slot-filler -stop-after mips-branch-expansion | FileCheck %s --check-prefix=MIPS
3 # RUN: llc -mtriple=mips-mti-linux-gnu %s -o - -start-before mips-delay-slot-filler -stop-after mips-branch-expansion -relocation-model=pic | FileCheck %s --check-prefix=PIC
4 # Test the long branch expansion of various branches
8 define i32 @a(double %a, double %b) {
10 %cmp = fcmp une double %a, %b
11 br i1 %cmp, label %if.then, label %return
14 call void asm sideeffect ".space 310680", "~{$1}"()
21 define i32 @b(double %a, double %b) {
23 %cmp = fcmp une double %a, %b
24 br i1 %cmp, label %if.then, label %return
27 call void asm sideeffect ".space 310680", "~{$1}"()
38 exposesReturnsTwice: false
40 regBankSelected: false
43 tracksRegLiveness: true
46 - { reg: '$d6', virtual-reg: '' }
47 - { reg: '$d7', virtual-reg: '' }
49 isFrameAddressTaken: false
50 isReturnAddressTaken: false
60 hasOpaqueSPAdjustment: false
62 hasMustTailInVarArgFunc: false
72 ; MIPS: successors: %bb.2(0x50000000), %bb.1(0x30000000)
73 ; MIPS: FCMP_D32 killed renamable $d6, killed renamable $d7, 2, implicit-def $fcc0
74 ; MIPS: BC1F $fcc0, %bb.2, implicit-def $at {
75 ; MIPS: $zero = SLL $zero, 0
78 ; MIPS: successors: %bb.3(0x80000000)
79 ; MIPS: J %bb.3, implicit-def $at {
80 ; MIPS: $zero = SLL $zero, 0
83 ; MIPS: INLINEASM &".space 310680", 1 /* sideeffect attdialect */, 12 /* clobber */, implicit-def dead early-clobber $at
84 ; MIPS: PseudoReturn undef $ra, implicit killed $v0 {
85 ; MIPS: $v0 = ADDiu $zero, 0
88 ; MIPS: PseudoReturn undef $ra, implicit killed $v0 {
89 ; MIPS: $v0 = ADDiu $zero, 1
93 ; PIC: successors: %bb.3(0x50000000), %bb.1(0x30000000)
94 ; PIC: FCMP_D32 killed renamable $d6, killed renamable $d7, 2, implicit-def $fcc0
95 ; PIC: BC1F $fcc0, %bb.3, implicit-def $at {
96 ; PIC: $zero = SLL $zero, 0
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: BAL_BR %bb.2, implicit-def $ra {
104 ; PIC: $at = LONG_BRANCH_ADDiu $at, target-flags(mips-abs-lo) %bb.4, %bb.2
107 ; PIC: successors: %bb.4(0x80000000)
108 ; PIC: $at = ADDu $ra, $at
109 ; PIC: $ra = LW $sp, 0
111 ; PIC: $sp = ADDiu $sp, 8
114 ; PIC: INLINEASM &".space 310680", 1 /* sideeffect attdialect */, 12 /* clobber */, implicit-def dead early-clobber $at
115 ; PIC: PseudoReturn undef $ra, implicit killed $v0 {
116 ; PIC: $v0 = ADDiu $zero, 0
119 ; PIC: PseudoReturn undef $ra, implicit killed $v0 {
120 ; PIC: $v0 = ADDiu $zero, 1
123 successors: %bb.1(0x50000000), %bb.2(0x30000000)
126 FCMP_D32 killed renamable $d6, killed renamable $d7, 2, implicit-def $fcc0
127 BC1T killed $fcc0, %bb.2, implicit-def $at
130 INLINEASM &".space 310680", 1, 12, implicit-def dead early-clobber $at
132 PseudoReturn undef $ra, implicit killed $v0
136 PseudoReturn undef $ra, implicit killed $v0
142 exposesReturnsTwice: false
144 regBankSelected: false
147 tracksRegLiveness: true
150 - { reg: '$d6', virtual-reg: '' }
151 - { reg: '$d7', virtual-reg: '' }
153 isFrameAddressTaken: false
154 isReturnAddressTaken: false
164 hasOpaqueSPAdjustment: false
166 hasMustTailInVarArgFunc: false
174 ; MIPS-LABEL: name: b
176 ; MIPS: successors: %bb.2(0x50000000), %bb.1(0x30000000)
177 ; MIPS: FCMP_D32 killed renamable $d6, killed renamable $d7, 2, implicit-def $fcc0
178 ; MIPS: BC1T $fcc0, %bb.2, implicit-def $at {
179 ; MIPS: $zero = SLL $zero, 0
182 ; MIPS: successors: %bb.3(0x80000000)
183 ; MIPS: J %bb.3, implicit-def $at {
184 ; MIPS: $zero = SLL $zero, 0
186 ; MIPS: bb.2.if.then:
187 ; MIPS: INLINEASM &".space 310680", 1 /* sideeffect attdialect */, 12 /* clobber */, implicit-def dead early-clobber $at
188 ; MIPS: PseudoReturn undef $ra, implicit killed $v0 {
189 ; MIPS: $v0 = ADDiu $zero, 0
192 ; MIPS: PseudoReturn undef $ra, implicit killed $v0 {
193 ; MIPS: $v0 = ADDiu $zero, 1
197 ; PIC: successors: %bb.3(0x50000000), %bb.1(0x30000000)
198 ; PIC: FCMP_D32 killed renamable $d6, killed renamable $d7, 2, implicit-def $fcc0
199 ; PIC: BC1T $fcc0, %bb.3, implicit-def $at {
200 ; PIC: $zero = SLL $zero, 0
203 ; PIC: successors: %bb.2(0x80000000)
204 ; PIC: $sp = ADDiu $sp, -8
205 ; PIC: SW $ra, $sp, 0
206 ; PIC: $at = LONG_BRANCH_LUi target-flags(mips-abs-hi) %bb.4, %bb.2
207 ; PIC: BAL_BR %bb.2, implicit-def $ra {
208 ; PIC: $at = LONG_BRANCH_ADDiu $at, target-flags(mips-abs-lo) %bb.4, %bb.2
211 ; PIC: successors: %bb.4(0x80000000)
212 ; PIC: $at = ADDu $ra, $at
213 ; PIC: $ra = LW $sp, 0
215 ; PIC: $sp = ADDiu $sp, 8
218 ; PIC: INLINEASM &".space 310680", 1 /* sideeffect attdialect */, 12 /* clobber */, implicit-def dead early-clobber $at
219 ; PIC: PseudoReturn undef $ra, implicit killed $v0 {
220 ; PIC: $v0 = ADDiu $zero, 0
223 ; PIC: PseudoReturn undef $ra, implicit killed $v0 {
224 ; PIC: $v0 = ADDiu $zero, 1
227 successors: %bb.1(0x50000000), %bb.2(0x30000000)
230 FCMP_D32 killed renamable $d6, killed renamable $d7, 2, implicit-def $fcc0
231 BC1F killed $fcc0, %bb.2, implicit-def $at
234 INLINEASM &".space 310680", 1, 12, implicit-def dead early-clobber $at
236 PseudoReturn undef $ra, implicit killed $v0
240 PseudoReturn undef $ra, implicit killed $v0