annotate test/CodeGen/Thumb/tbb-reuse.mir @ 134:3a76565eade5 LLVM5.0.1

update 5.0.1
author mir3636
date Sat, 17 Feb 2018 09:57:20 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 # RUN: llc -run-pass arm-cp-islands %s -o - | FileCheck %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 --- |
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 ; ModuleID = '<stdin>'
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 source_filename = "<stdin>"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 target triple = "thumbv6m--none-eabi"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 declare void @exit0()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 declare void @exit1(i32)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 declare void @exit2()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 declare void @exit3()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 declare void @exit4()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 define void @jump_table(i32 %val, i32 %arg2, i32 %arg3, i32 %arg4) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 switch i32 %val, label %default [
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 i32 1, label %lab1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 i32 2, label %lab2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 i32 3, label %lab3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 i32 4, label %lab4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 ]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 default: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 tail call void @exit0()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 lab1: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 %b = sub i32 %val, 1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 %a = shl i32 %b, 2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 tail call void @exit1(i32 %a)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 lab2: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 tail call void @exit2()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 lab3: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 tail call void @exit3()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 lab4: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 tail call void @exit4()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 ; Function Attrs: nounwind
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 declare void @llvm.stackprotector(i8*, i8**) #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 attributes #0 = { nounwind }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 ...
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 name: jump_table
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 alignment: 1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 exposesReturnsTwice: false
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 legalized: false
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 regBankSelected: false
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 selected: false
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 tracksRegLiveness: true
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65 liveins:
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
66 - { reg: '$r0' }
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
67 calleeSavedRegisters: [ '$lr', '$d8', '$d9', '$d10', '$d11', '$d12', '$d13',
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
68 '$d14', '$d15', '$q4', '$q5', '$q6', '$q7', '$r4',
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
69 '$r5', '$r6', '$r7', '$r8', '$r9', '$r10', '$r11',
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
70 '$s16', '$s17', '$s18', '$s19', '$s20', '$s21',
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
71 '$s22', '$s23', '$s24', '$s25', '$s26', '$s27',
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
72 '$s28', '$s29', '$s30', '$s31', '$d8_d10', '$d9_d11',
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
73 '$d10_d12', '$d11_d13', '$d12_d14', '$d13_d15',
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
74 '$q4_q5', '$q5_q6', '$q6_q7', '$q4_q5_q6_q7', '$r4_r5',
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
75 '$r6_r7', '$r8_r9', '$r10_r11', '$d8_d9_d10', '$d9_d10_d11',
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
76 '$d10_d11_d12', '$d11_d12_d13', '$d12_d13_d14',
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
77 '$d13_d14_d15', '$d8_d10_d12', '$d9_d11_d13', '$d10_d12_d14',
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
78 '$d11_d13_d15', '$d8_d10_d12_d14', '$d9_d11_d13_d15',
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
79 '$d9_d10', '$d11_d12', '$d13_d14', '$d9_d10_d11_d12',
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
80 '$d11_d12_d13_d14' ]
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81 frameInfo:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82 isFrameAddressTaken: false
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83 isReturnAddressTaken: false
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84 hasStackMap: false
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85 hasPatchPoint: false
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86 stackSize: 8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87 offsetAdjustment: 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88 maxAlignment: 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89 adjustsStack: true
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90 hasCalls: true
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 maxCallFrameSize: 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92 hasOpaqueSPAdjustment: false
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93 hasVAStart: false
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
94 hasMustTailInVarArgFunc: false
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
95 stack:
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
96 - { id: 0, type: spill-slot, offset: -4, size: 4, alignment: 4, callee-saved-register: '$lr', callee-saved-restored: false }
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
97 - { id: 1, type: spill-slot, offset: -8, size: 4, alignment: 4, callee-saved-register: '$r7' }
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
98 jumpTable:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
99 kind: inline
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
100 entries:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
101 - id: 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
102 blocks: [ '%bb.3.lab1', '%bb.4.lab2', '%bb.5.lab3', '%bb.6.lab4' ]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
103 # r1 is redefined in the middle of the recognizable jump sequence - it shouldn't be clobbered!
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
104 # CHECK-NOT: tTBB_JT
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
105
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
106 body: |
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
107 bb.0.entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
108 successors: %bb.2.default(0x19999998), %bb.1.entry(0x66666668)
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
109 liveins: $r0, $r7, $lr
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
110
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
111 frame-setup tPUSH 14, $noreg, killed $r7, killed $lr, implicit-def $sp, implicit $sp
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
112 frame-setup CFI_INSTRUCTION def_cfa_offset 8
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
113 frame-setup CFI_INSTRUCTION offset $lr, -4
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
114 frame-setup CFI_INSTRUCTION offset $r7, -8
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
115 $r1, dead $cpsr = tSUBi3 $r0, 1, 14, $noreg
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
116 tCMPi8 $r1, 3, 14, $noreg, implicit-def $cpsr
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
117 tBcc %bb.2.default, 8, killed $cpsr
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
118
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
119 bb.1.entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
120 successors: %bb.3.lab1(0x20000000), %bb.4.lab2(0x20000000), %bb.5.lab3(0x20000000), %bb.6.lab4(0x20000000)
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
121 liveins: $r0, $r1
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
122
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
123 $r1, dead $cpsr = tLSLri killed $r1, 2, 14, $noreg
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
124 $r2 = tLEApcrelJT %jump-table.0, 14, $noreg
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
125 $r2 = tLDRr killed $r1, killed $r2, 14, $noreg :: (load 4 from jump-table)
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
126 $r1, dead $cpsr = tLSLri $r2, 2, 14, $noreg
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
127 tBR_JTr killed $r2, %jump-table.0
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
128
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
129 bb.2.default:
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
130 tBL 14, $noreg, @exit0, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
131 tPOP_RET 14, $noreg, def $r7, def $pc, implicit-def $sp, implicit $sp
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
132
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
133 bb.3.lab1:
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
134 liveins: $r0,$r1
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
135
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
136 tBL 14, $noreg, @exit1, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit-def $sp
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
137 tPOP_RET 14, $noreg, def $r7, def $pc, implicit-def $sp, implicit $sp
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
138
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
139 bb.4.lab2:
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
140 tBL 14, $noreg, @exit2, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
141 tPOP_RET 14, $noreg, def $r7, def $pc, implicit-def $sp, implicit $sp
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
142
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
143 bb.5.lab3:
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
144 tBL 14, $noreg, @exit3, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
145 tPOP_RET 14, $noreg, def $r7, def $pc, implicit-def $sp, implicit $sp
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
146
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
147 bb.6.lab4:
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
148 tBL 14, $noreg, @exit4, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
149 tPOP_RET 14, $noreg, def $r7, def $pc, implicit-def $sp, implicit $sp
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
150
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
151 ...