1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=mips-img-linux-gnu -mcpu=mips32r6 -mattr=+micromips %s -o - -start-before mips-delay-slot-filler -stop-after mips-branch-expansion | FileCheck %s --check-prefix=MM
3 # RUN: llc -mtriple=mips-img-linux-gnu -mcpu=mips32r6 -mattr=+micromips %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
15 call void asm sideeffect ".space 810680", "~{$1}"()
22 define i32 @b(double %a, double %b) {
24 %cmp = fcmp ueq double %a, %b
25 br i1 %cmp, label %if.then, label %return
28 call void asm sideeffect ".space 810680", "~{$1}"()
39 exposesReturnsTwice: false
41 regBankSelected: false
44 tracksRegLiveness: true
47 - { reg: '$d12_64', virtual-reg: '' }
48 - { reg: '$d14_64', virtual-reg: '' }
50 isFrameAddressTaken: false
51 isReturnAddressTaken: false
61 hasOpaqueSPAdjustment: false
63 hasMustTailInVarArgFunc: false
73 ; MM: successors: %bb.2(0x50000000), %bb.1(0x30000000)
74 ; MM: $f0 = CMP_EQ_D_MMR6 killed $d12_64, killed $d14_64
75 ; MM: BC1EQZC_MMR6 $d0_64, %bb.2, implicit-def $at
77 ; MM: successors: %bb.3(0x80000000)
80 ; MM: INLINEASM &".space 810680", 1, 12, implicit-def dead early-clobber $at
82 ; MM: JRC16_MM undef $ra, implicit $v0
85 ; MM: JRC16_MM undef $ra, implicit $v0
88 ; PIC: successors: %bb.3(0x50000000), %bb.1(0x30000000)
89 ; PIC: $f0 = CMP_EQ_D_MMR6 killed $d12_64, killed $d14_64
90 ; PIC: BC1EQZC_MMR6 $d0_64, %bb.3, implicit-def $at
92 ; PIC: successors: %bb.2(0x80000000)
93 ; PIC: $sp = ADDiu $sp, -8
95 ; PIC: $at = LONG_BRANCH_LUi target-flags(mips-abs-hi) %bb.4, %bb.2
96 ; PIC: $at = LONG_BRANCH_ADDiu $at, target-flags(mips-abs-lo) %bb.4, %bb.2
97 ; PIC: BALC_MMR6 %bb.2, implicit-def $ra
99 ; PIC: successors: %bb.4(0x80000000)
100 ; PIC: $at = ADDu $ra, $at
101 ; PIC: $ra = LW $sp, 0
102 ; PIC: $sp = ADDiu $sp, 8
103 ; PIC: JIC_MMR6 $at, 0, implicit-def $at
105 ; PIC: INLINEASM &".space 810680", 1, 12, implicit-def dead early-clobber $at
106 ; PIC: $v0 = LI16_MM 0
107 ; PIC: JRC16_MM undef $ra, implicit $v0
109 ; PIC: $v0 = LI16_MM 1
110 ; PIC: JRC16_MM undef $ra, implicit $v0
112 successors: %bb.1(0x50000000), %bb.2(0x30000000)
113 liveins: $d12_64, $d14_64
115 $f0 = CMP_EQ_D_MMR6 killed $d12_64, killed $d14_64
116 BC1NEZC_MMR6 killed $d0_64, %bb.2, implicit-def $at
119 INLINEASM &".space 810680", 1, 12, implicit-def dead early-clobber $at
121 PseudoReturn undef $ra, implicit $v0
125 PseudoReturn undef $ra, implicit $v0
131 exposesReturnsTwice: false
133 regBankSelected: false
136 tracksRegLiveness: true
139 - { reg: '$d12_64', virtual-reg: '' }
140 - { reg: '$d14_64', virtual-reg: '' }
142 isFrameAddressTaken: false
143 isReturnAddressTaken: false
153 hasOpaqueSPAdjustment: false
155 hasMustTailInVarArgFunc: false
165 ; MM: successors: %bb.2(0x30000000), %bb.1(0x50000000)
166 ; MM: $f0 = CMP_UEQ_D_MMR6 killed $d12_64, killed $d14_64
167 ; MM: BC1NEZC_MMR6 $d0_64, %bb.2, implicit-def $at
169 ; MM: successors: %bb.3(0x80000000)
172 ; MM: INLINEASM &".space 810680", 1, 12, implicit-def dead early-clobber $at
173 ; MM: $v0 = LI16_MM 0
174 ; MM: JRC16_MM undef $ra, implicit $v0
176 ; MM: $v0 = LI16_MM 1
177 ; MM: JRC16_MM undef $ra, implicit $v0
180 ; PIC: successors: %bb.3(0x30000000), %bb.1(0x50000000)
181 ; PIC: $f0 = CMP_UEQ_D_MMR6 killed $d12_64, killed $d14_64
182 ; PIC: BC1NEZC_MMR6 $d0_64, %bb.3, implicit-def $at
184 ; PIC: successors: %bb.2(0x80000000)
185 ; PIC: $sp = ADDiu $sp, -8
186 ; PIC: SW $ra, $sp, 0
187 ; PIC: $at = LONG_BRANCH_LUi target-flags(mips-abs-hi) %bb.4, %bb.2
188 ; PIC: $at = LONG_BRANCH_ADDiu $at, target-flags(mips-abs-lo) %bb.4, %bb.2
189 ; PIC: BALC_MMR6 %bb.2, implicit-def $ra
191 ; PIC: successors: %bb.4(0x80000000)
192 ; PIC: $at = ADDu $ra, $at
193 ; PIC: $ra = LW $sp, 0
194 ; PIC: $sp = ADDiu $sp, 8
195 ; PIC: JIC_MMR6 $at, 0, implicit-def $at
197 ; PIC: INLINEASM &".space 810680", 1, 12, implicit-def dead early-clobber $at
198 ; PIC: $v0 = LI16_MM 0
199 ; PIC: JRC16_MM undef $ra, implicit $v0
201 ; PIC: $v0 = LI16_MM 1
202 ; PIC: JRC16_MM undef $ra, implicit $v0
204 successors: %bb.1(0x30000000), %bb.2(0x50000000)
205 liveins: $d12_64, $d14_64
207 $f0 = CMP_UEQ_D_MMR6 killed $d12_64, killed $d14_64
208 BC1EQZC_MMR6 killed $d0_64, %bb.2, implicit-def $at
211 INLINEASM &".space 810680", 1, 12, implicit-def dead early-clobber $at
213 PseudoReturn undef $ra, implicit $v0
217 PseudoReturn undef $ra, implicit $v0