llvm.org GIT mirror llvm / d4a91bb
[ARM] GlobalISel: Support G_BR This boils down to not crashing in reg bank select due to the lack of register operands on this instruction, and adding some tests. The instruction selection is already covered by the TableGen'erated code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307904 91177308-0d34-0410-b5e6-96231b3b80d8 Diana Picus 3 years ago
4 changed file(s) with 55 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
330330 &ARM::ValueMappings[ARM::DPR3OpsIdx]});
331331 break;
332332 }
333 case G_BR:
334 OperandsMapping = getOperandsMapping({nullptr});
335 break;
333336 default:
334337 return getInvalidInstructionMapping();
335338 }
4343
4444 define void @test_select_s32() { ret void }
4545 define void @test_select_ptr() { ret void }
46
47 define void @test_br() { ret void }
4648
4749 define void @test_soft_fp_double() #0 { ret void }
4850
11721174 ; CHECK: BX_RET 14, _, implicit %r0
11731175 ...
11741176 ---
1177 name: test_br
1178 # CHECK-LABEL: name: test_br
1179 legalized: true
1180 regBankSelected: true
1181 selected: false
1182 # CHECK: selected: true
1183 body: |
1184 ; CHECK: bb.0
1185 bb.0:
1186 successors: %bb.1(0x80000000)
1187
1188 ; CHECK: bb.1
1189 bb.1:
1190 successors: %bb.1(0x80000000)
1191
1192 ; CHECK: B %bb.1
1193 G_BR %bb.1
1194 ...
1195 ---
11751196 name: test_soft_fp_double
11761197 # CHECK-LABEL: name: test_soft_fp_double
11771198 legalized: true
419419 %r = select i1 %cond, i32* %a, i32* %b
420420 ret i32* %r
421421 }
422
423 define arm_aapcscc void @test_br() {
424 ; CHECK-LABEL: test_br
425 ; CHECK: [[LABEL:.L[[:alnum:]_]+]]:
426 ; CHECK: b [[LABEL]]
427 entry:
428 br label %infinite
429
430 infinite:
431 br label %infinite
432 }
3838 define void @test_fcmp_ugt_s64() #0 { ret void }
3939
4040 define void @test_select_s32() { ret void }
41
42 define void @test_br() { ret void }
4143
4244 define void @test_fadd_s32() #0 { ret void }
4345 define void @test_fadd_s64() #0 { ret void }
829831
830832 ...
831833 ---
834 name: test_br
835 # CHECK-LABEL: name: test_br
836 legalized: true
837 regBankSelected: false
838 # CHECK: regBankSelected: true
839 # There aren't any registers to map, but make sure we don't crash.
840 selected: false
841 body: |
842 bb.0:
843 successors: %bb.1(0x80000000)
844
845 bb.1:
846 successors: %bb.1(0x80000000)
847
848 G_BR %bb.1
849
850 ...
851 ---
832852 name: test_fadd_s32
833853 # CHECK-LABEL: name: test_fadd_s32
834854 legalized: true