1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=mips-mti-linux-gnu -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-mti-linux-gnu -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 310680", "~{$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 310680", "~{$1}"()
39 exposesReturnsTwice: false
41 regBankSelected: false
44 tracksRegLiveness: true
47 - { reg: '$d6', virtual-reg: '' }
48 - { reg: '$d7', 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: FCMP_D32_MM killed renamable $d6, killed renamable $d7, 2, implicit-def $fcc0
75 ; MM: BC1F_MM $fcc0, %bb.2, implicit-def $at {
79 ; MM: successors: %bb.3(0x80000000)
80 ; MM: J %bb.3, implicit-def $at {
84 ; MM: INLINEASM &".space 310680", 1, 12, implicit-def dead early-clobber $at
86 ; MM: JRC16_MM undef $ra, implicit killed $v0
89 ; MM: JRC16_MM undef $ra, implicit killed $v0
92 ; PIC: successors: %bb.3(0x50000000), %bb.1(0x30000000)
93 ; PIC: FCMP_D32_MM killed renamable $d6, killed renamable $d7, 2, implicit-def $fcc0
94 ; PIC: BC1F_MM $fcc0, %bb.3, implicit-def $at {
98 ; PIC: successors: %bb.2(0x80000000)
99 ; PIC: $sp = ADDiu $sp, -8
100 ; PIC: SW $ra, $sp, 0
101 ; PIC: $at = LONG_BRANCH_LUi target-flags(mips-abs-hi) %bb.4, %bb.2
102 ; PIC: BAL_BR_MM %bb.2, implicit-def $ra {
103 ; PIC: $at = LONG_BRANCH_ADDiu $at, target-flags(mips-abs-lo) %bb.4, %bb.2
106 ; PIC: successors: %bb.4(0x80000000)
107 ; PIC: $at = ADDu $ra, $at
108 ; PIC: $ra = LW $sp, 0
110 ; PIC: $sp = ADDiu $sp, 8
113 ; PIC: INLINEASM &".space 310680", 1, 12, implicit-def dead early-clobber $at
114 ; PIC: $v0 = LI16_MM 0
115 ; PIC: JRC16_MM undef $ra, implicit killed $v0
117 ; PIC: $v0 = LI16_MM 1
118 ; PIC: JRC16_MM undef $ra, implicit killed $v0
120 successors: %bb.1(0x50000000), %bb.2(0x30000000)
123 FCMP_D32_MM killed renamable $d6, killed renamable $d7, 2, implicit-def $fcc0
124 BC1T_MM killed $fcc0, %bb.2, implicit-def dead $at
127 INLINEASM &".space 310680", 1, 12, implicit-def dead early-clobber $at
129 PseudoReturn undef $ra, implicit killed $v0
133 PseudoReturn undef $ra, implicit killed $v0
139 exposesReturnsTwice: false
141 regBankSelected: false
144 tracksRegLiveness: true
147 - { reg: '$d6', virtual-reg: '' }
148 - { reg: '$d7', virtual-reg: '' }
150 isFrameAddressTaken: false
151 isReturnAddressTaken: false
161 hasOpaqueSPAdjustment: false
163 hasMustTailInVarArgFunc: false
173 ; MM: successors: %bb.2(0x30000000), %bb.1(0x50000000)
174 ; MM: FCMP_D32_MM killed renamable $d6, killed renamable $d7, 19, implicit-def $fcc0
175 ; MM: BC1F_MM killed $fcc0, %bb.1, implicit-def dead $at {
179 ; MM: $v0 = LI16_MM 1
180 ; MM: JRC16_MM undef $ra, implicit killed $v0
182 ; MM: INLINEASM &".space 310680", 1, 12, implicit-def dead early-clobber $at
183 ; MM: $v0 = LI16_MM 0
184 ; MM: JRC16_MM undef $ra, implicit killed $v0
187 ; PIC: successors: %bb.2(0x30000000), %bb.1(0x50000000)
188 ; PIC: FCMP_D32_MM killed renamable $d6, killed renamable $d7, 19, implicit-def $fcc0
189 ; PIC: BC1F_MM killed $fcc0, %bb.1, implicit-def dead $at {
193 ; PIC: $v0 = LI16_MM 1
194 ; PIC: JRC16_MM undef $ra, implicit killed $v0
196 ; PIC: INLINEASM &".space 310680", 1, 12, implicit-def dead early-clobber $at
197 ; PIC: $v0 = LI16_MM 0
198 ; PIC: JRC16_MM undef $ra, implicit killed $v0
200 successors: %bb.1(0x30000000), %bb.2(0x50000000)
203 FCMP_D32_MM killed renamable $d6, killed renamable $d7, 19, implicit-def $fcc0
204 BC1F_MM killed $fcc0, %bb.2, implicit-def dead $at
208 PseudoReturn undef $ra, implicit killed $v0
211 INLINEASM &".space 310680", 1, 12, implicit-def dead early-clobber $at
213 PseudoReturn undef $ra, implicit killed $v0