blob: 83c489de1e7744c55c578a0e2cd0ee6846b11200 [file] [log] [blame]
Simon Dardis0a47edb2017-04-04 11:28:53 +00001# RUN: llc -march=mipsel -mcpu=mips32r6 -start-after=block-placement %s -o - | FileCheck %s
2
3# Check that empty blocks in the cfg don't cause the mips hazard scheduler to
4# crash and that the nop is inserted correctly.
5
6# CHECK: blezc
7# CHECK: nop
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +00008# CHECK: # %bb.1:
Simon Dardis0a47edb2017-04-04 11:28:53 +00009# CHECK: .insn
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000010# CHECK: # %bb.2:
Simon Dardis0a47edb2017-04-04 11:28:53 +000011# CHECK: .insn
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000012# CHECK: # %bb.3:
Simon Dardis0a47edb2017-04-04 11:28:53 +000013# CHECK: jal
14
15--- |
16 ; ModuleID = '<stdin>'
17 source_filename = "<stdin>"
18 target datalayout = "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64"
19
20 declare i32 @k()
21
22 declare void @f(i32)
23
24 define void @l5() {
25 entry:
26 %call = tail call i32 @k()
27 %cmp = icmp sgt i32 %call, 0
28 br i1 %cmp, label %if.then, label %if.end
29
30 if.then: ; preds = %entry
31 tail call void @f(i32 signext 2)
32 br label %if.end
33
34 if.end: ; preds = %if.then, %entry
35 ret void
36 }
37
38---
39name: l5
40alignment: 2
41exposesReturnsTwice: false
Simon Dardis0a47edb2017-04-04 11:28:53 +000042legalized: false
43regBankSelected: false
44selected: false
45tracksRegLiveness: true
46frameInfo:
47 isFrameAddressTaken: false
48 isReturnAddressTaken: false
49 hasStackMap: false
50 hasPatchPoint: false
51 stackSize: 24
52 offsetAdjustment: 0
53 maxAlignment: 4
54 adjustsStack: true
55 hasCalls: true
56 maxCallFrameSize: 16
57 hasOpaqueSPAdjustment: false
58 hasVAStart: false
59 hasMustTailInVarArgFunc: false
60stack:
Puyan Lotfi43e94b12018-01-31 22:04:26 +000061 - { id: 0, type: spill-slot, offset: -4, size: 4, alignment: 4, callee-saved-register: '$ra' }
Simon Dardis0a47edb2017-04-04 11:28:53 +000062body: |
63 bb.0.entry:
64 successors: %bb.1.if.then(0x50000000), %bb.4.if.end(0x30000000)
Puyan Lotfi43e94b12018-01-31 22:04:26 +000065 liveins: $ra
Simon Dardis0a47edb2017-04-04 11:28:53 +000066
Puyan Lotfi43e94b12018-01-31 22:04:26 +000067 $sp = ADDiu $sp, -24
Simon Dardis0a47edb2017-04-04 11:28:53 +000068 CFI_INSTRUCTION def_cfa_offset 24
Puyan Lotfi43e94b12018-01-31 22:04:26 +000069 SW killed $ra, $sp, 20 :: (store 4 into %stack.0)
70 CFI_INSTRUCTION offset $ra_64, -4
71 JAL @k, csr_o32_fp64, implicit-def dead $ra, implicit-def $sp, implicit-def $v0
72 BLEZ $v0, %bb.4.if.end, implicit-def $at
Simon Dardis0a47edb2017-04-04 11:28:53 +000073
74 bb.1.if.then:
75 successors: %bb.2.if.then(0x80000000)
76
77 bb.2.if.then:
78 successors: %bb.3.if.then(0x80000000)
79
80 bb.3.if.then:
81 successors: %bb.4.if.end(0x80000000)
82
Puyan Lotfi43e94b12018-01-31 22:04:26 +000083 $a0 = ADDiu $zero, 2
84 JAL @f, csr_o32_fp64, implicit-def dead $ra, implicit killed $a0, implicit-def $sp
Simon Dardis0a47edb2017-04-04 11:28:53 +000085
86 bb.4.if.end:
Puyan Lotfi43e94b12018-01-31 22:04:26 +000087 $ra = LW $sp, 20 :: (load 4 from %stack.0)
88 $sp = ADDiu $sp, 24
89 PseudoReturn undef $ra
Simon Dardis0a47edb2017-04-04 11:28:53 +000090
91...