1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \
3 ; RUN: -ppc-min-jump-table-entries=4 -code-model=small -stop-after=machine-cp < %s | FileCheck \
4 ; RUN: --check-prefix=32SMALL-MIR %s
6 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \
7 ; RUN: -ppc-min-jump-table-entries=4 -code-model=large -stop-after=machine-cp < %s | FileCheck \
8 ; RUN: --check-prefix=32LARGE-MIR %s
10 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff \
11 ; RUN: -ppc-min-jump-table-entries=4 -code-model=small -stop-after=machine-cp < %s | FileCheck \
12 ; RUN: --check-prefix=64SMALL-MIR %s
14 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff \
15 ; RUN: -ppc-min-jump-table-entries=4 -code-model=large -stop-after=machine-cp < %s | FileCheck \
16 ; RUN: --check-prefix=64LARGE-MIR %s
18 define i32 @jump_table(i32 %a) {
19 ; 32SMALL-MIR-LABEL: name: jump_table
20 ; 32SMALL-MIR: bb.0.entry:
21 ; 32SMALL-MIR-NEXT: successors: %bb.6(0x19999998), %bb.1(0x66666668)
22 ; 32SMALL-MIR-NEXT: liveins: $r3
23 ; 32SMALL-MIR-NEXT: {{ $}}
24 ; 32SMALL-MIR-NEXT: renamable $r3 = ADDI killed renamable $r3, -1
25 ; 32SMALL-MIR-NEXT: renamable $cr0 = CMPLWI renamable $r3, 3
26 ; 32SMALL-MIR-NEXT: BCC 44, killed renamable $cr0, %bb.6
27 ; 32SMALL-MIR-NEXT: {{ $}}
28 ; 32SMALL-MIR-NEXT: bb.1.entry:
29 ; 32SMALL-MIR-NEXT: successors: %bb.2(0x20000000), %bb.3(0x20000000), %bb.4(0x20000000), %bb.5(0x20000000)
30 ; 32SMALL-MIR-NEXT: liveins: $r3
31 ; 32SMALL-MIR-NEXT: {{ $}}
32 ; 32SMALL-MIR-NEXT: renamable $r3 = RLWINM killed renamable $r3, 2, 0, 29
33 ; 32SMALL-MIR-NEXT: renamable $r4 = LWZtoc %jump-table.0, $r2 :: (load (s32) from got)
34 ; 32SMALL-MIR-NEXT: renamable $r3 = LWZX killed renamable $r3, renamable $r4 :: (load (s32) from jump-table)
35 ; 32SMALL-MIR-NEXT: renamable $r3 = ADD4 killed renamable $r3, killed renamable $r4
36 ; 32SMALL-MIR-NEXT: MTCTR killed renamable $r3, implicit-def $ctr
37 ; 32SMALL-MIR-NEXT: BCTR implicit $ctr
38 ; 32SMALL-MIR-NEXT: {{ $}}
39 ; 32SMALL-MIR-NEXT: bb.2.sw.bb:
40 ; 32SMALL-MIR-NEXT: successors: %bb.6(0x80000000)
41 ; 32SMALL-MIR-NEXT: {{ $}}
42 ; 32SMALL-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
43 ; 32SMALL-MIR-NEXT: B %bb.6
44 ; 32SMALL-MIR-NEXT: {{ $}}
45 ; 32SMALL-MIR-NEXT: bb.3.sw.bb1:
46 ; 32SMALL-MIR-NEXT: successors: %bb.6(0x80000000)
47 ; 32SMALL-MIR-NEXT: {{ $}}
48 ; 32SMALL-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
49 ; 32SMALL-MIR-NEXT: B %bb.6
50 ; 32SMALL-MIR-NEXT: {{ $}}
51 ; 32SMALL-MIR-NEXT: bb.4.sw.bb2:
52 ; 32SMALL-MIR-NEXT: successors: %bb.6(0x80000000)
53 ; 32SMALL-MIR-NEXT: {{ $}}
54 ; 32SMALL-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
55 ; 32SMALL-MIR-NEXT: B %bb.6
56 ; 32SMALL-MIR-NEXT: {{ $}}
57 ; 32SMALL-MIR-NEXT: bb.5.sw.bb3:
58 ; 32SMALL-MIR-NEXT: successors: %bb.6(0x80000000)
59 ; 32SMALL-MIR-NEXT: {{ $}}
60 ; 32SMALL-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
61 ; 32SMALL-MIR-NEXT: {{ $}}
62 ; 32SMALL-MIR-NEXT: bb.6.sw.epilog:
63 ; 32SMALL-MIR-NEXT: $r3 = LI 0
64 ; 32SMALL-MIR-NEXT: BLR implicit $lr, implicit $rm, implicit $r3
66 ; 32LARGE-MIR-LABEL: name: jump_table
67 ; 32LARGE-MIR: bb.0.entry:
68 ; 32LARGE-MIR-NEXT: successors: %bb.6(0x19999998), %bb.1(0x66666668)
69 ; 32LARGE-MIR-NEXT: liveins: $r3
70 ; 32LARGE-MIR-NEXT: {{ $}}
71 ; 32LARGE-MIR-NEXT: renamable $r3 = ADDI killed renamable $r3, -1
72 ; 32LARGE-MIR-NEXT: renamable $cr0 = CMPLWI renamable $r3, 3
73 ; 32LARGE-MIR-NEXT: BCC 44, killed renamable $cr0, %bb.6
74 ; 32LARGE-MIR-NEXT: {{ $}}
75 ; 32LARGE-MIR-NEXT: bb.1.entry:
76 ; 32LARGE-MIR-NEXT: successors: %bb.2(0x20000000), %bb.3(0x20000000), %bb.4(0x20000000), %bb.5(0x20000000)
77 ; 32LARGE-MIR-NEXT: liveins: $r3
78 ; 32LARGE-MIR-NEXT: {{ $}}
79 ; 32LARGE-MIR-NEXT: renamable $r3 = RLWINM killed renamable $r3, 2, 0, 29
80 ; 32LARGE-MIR-NEXT: renamable $r4 = ADDIStocHA $r2, %jump-table.0
81 ; 32LARGE-MIR-NEXT: renamable $r4 = LWZtocL %jump-table.0, killed renamable $r4, implicit $r2 :: (load (s32) from got)
82 ; 32LARGE-MIR-NEXT: renamable $r3 = LWZX killed renamable $r3, renamable $r4 :: (load (s32) from jump-table)
83 ; 32LARGE-MIR-NEXT: renamable $r3 = ADD4 killed renamable $r3, killed renamable $r4
84 ; 32LARGE-MIR-NEXT: MTCTR killed renamable $r3, implicit-def $ctr
85 ; 32LARGE-MIR-NEXT: BCTR implicit $ctr
86 ; 32LARGE-MIR-NEXT: {{ $}}
87 ; 32LARGE-MIR-NEXT: bb.2.sw.bb:
88 ; 32LARGE-MIR-NEXT: successors: %bb.6(0x80000000)
89 ; 32LARGE-MIR-NEXT: {{ $}}
90 ; 32LARGE-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
91 ; 32LARGE-MIR-NEXT: B %bb.6
92 ; 32LARGE-MIR-NEXT: {{ $}}
93 ; 32LARGE-MIR-NEXT: bb.3.sw.bb1:
94 ; 32LARGE-MIR-NEXT: successors: %bb.6(0x80000000)
95 ; 32LARGE-MIR-NEXT: {{ $}}
96 ; 32LARGE-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
97 ; 32LARGE-MIR-NEXT: B %bb.6
98 ; 32LARGE-MIR-NEXT: {{ $}}
99 ; 32LARGE-MIR-NEXT: bb.4.sw.bb2:
100 ; 32LARGE-MIR-NEXT: successors: %bb.6(0x80000000)
101 ; 32LARGE-MIR-NEXT: {{ $}}
102 ; 32LARGE-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
103 ; 32LARGE-MIR-NEXT: B %bb.6
104 ; 32LARGE-MIR-NEXT: {{ $}}
105 ; 32LARGE-MIR-NEXT: bb.5.sw.bb3:
106 ; 32LARGE-MIR-NEXT: successors: %bb.6(0x80000000)
107 ; 32LARGE-MIR-NEXT: {{ $}}
108 ; 32LARGE-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
109 ; 32LARGE-MIR-NEXT: {{ $}}
110 ; 32LARGE-MIR-NEXT: bb.6.sw.epilog:
111 ; 32LARGE-MIR-NEXT: $r3 = LI 0
112 ; 32LARGE-MIR-NEXT: BLR implicit $lr, implicit $rm, implicit $r3
114 ; 64SMALL-MIR-LABEL: name: jump_table
115 ; 64SMALL-MIR: bb.0.entry:
116 ; 64SMALL-MIR-NEXT: successors: %bb.6(0x19999998), %bb.1(0x66666668)
117 ; 64SMALL-MIR-NEXT: liveins: $x3
118 ; 64SMALL-MIR-NEXT: {{ $}}
119 ; 64SMALL-MIR-NEXT: renamable $r3 = ADDI renamable $r3, -1, implicit killed $x3, implicit-def $x3
120 ; 64SMALL-MIR-NEXT: renamable $cr0 = CMPLWI renamable $r3, 3
121 ; 64SMALL-MIR-NEXT: BCC 44, killed renamable $cr0, %bb.6
122 ; 64SMALL-MIR-NEXT: {{ $}}
123 ; 64SMALL-MIR-NEXT: bb.1.entry:
124 ; 64SMALL-MIR-NEXT: successors: %bb.2(0x20000000), %bb.3(0x20000000), %bb.4(0x20000000), %bb.5(0x20000000)
125 ; 64SMALL-MIR-NEXT: liveins: $x3
126 ; 64SMALL-MIR-NEXT: {{ $}}
127 ; 64SMALL-MIR-NEXT: renamable $x3 = RLDIC killed renamable $x3, 2, 30
128 ; 64SMALL-MIR-NEXT: renamable $x4 = LDtocJTI %jump-table.0, $x2 :: (load (s64) from got)
129 ; 64SMALL-MIR-NEXT: renamable $x3 = LWAX killed renamable $x3, renamable $x4 :: (load (s32) from jump-table)
130 ; 64SMALL-MIR-NEXT: renamable $x3 = ADD8 killed renamable $x3, killed renamable $x4
131 ; 64SMALL-MIR-NEXT: MTCTR8 killed renamable $x3, implicit-def $ctr8
132 ; 64SMALL-MIR-NEXT: BCTR8 implicit $ctr8
133 ; 64SMALL-MIR-NEXT: {{ $}}
134 ; 64SMALL-MIR-NEXT: bb.2.sw.bb:
135 ; 64SMALL-MIR-NEXT: successors: %bb.6(0x80000000)
136 ; 64SMALL-MIR-NEXT: {{ $}}
137 ; 64SMALL-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
138 ; 64SMALL-MIR-NEXT: B %bb.6
139 ; 64SMALL-MIR-NEXT: {{ $}}
140 ; 64SMALL-MIR-NEXT: bb.3.sw.bb1:
141 ; 64SMALL-MIR-NEXT: successors: %bb.6(0x80000000)
142 ; 64SMALL-MIR-NEXT: {{ $}}
143 ; 64SMALL-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
144 ; 64SMALL-MIR-NEXT: B %bb.6
145 ; 64SMALL-MIR-NEXT: {{ $}}
146 ; 64SMALL-MIR-NEXT: bb.4.sw.bb2:
147 ; 64SMALL-MIR-NEXT: successors: %bb.6(0x80000000)
148 ; 64SMALL-MIR-NEXT: {{ $}}
149 ; 64SMALL-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
150 ; 64SMALL-MIR-NEXT: B %bb.6
151 ; 64SMALL-MIR-NEXT: {{ $}}
152 ; 64SMALL-MIR-NEXT: bb.5.sw.bb3:
153 ; 64SMALL-MIR-NEXT: successors: %bb.6(0x80000000)
154 ; 64SMALL-MIR-NEXT: {{ $}}
155 ; 64SMALL-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
156 ; 64SMALL-MIR-NEXT: {{ $}}
157 ; 64SMALL-MIR-NEXT: bb.6.sw.epilog:
158 ; 64SMALL-MIR-NEXT: $x3 = LI8 0
159 ; 64SMALL-MIR-NEXT: BLR8 implicit $lr8, implicit $rm, implicit $x3
161 ; 64LARGE-MIR-LABEL: name: jump_table
162 ; 64LARGE-MIR: bb.0.entry:
163 ; 64LARGE-MIR-NEXT: successors: %bb.6(0x19999998), %bb.1(0x66666668)
164 ; 64LARGE-MIR-NEXT: liveins: $x3
165 ; 64LARGE-MIR-NEXT: {{ $}}
166 ; 64LARGE-MIR-NEXT: renamable $r3 = ADDI renamable $r3, -1, implicit killed $x3, implicit-def $x3
167 ; 64LARGE-MIR-NEXT: renamable $cr0 = CMPLWI renamable $r3, 3
168 ; 64LARGE-MIR-NEXT: BCC 44, killed renamable $cr0, %bb.6
169 ; 64LARGE-MIR-NEXT: {{ $}}
170 ; 64LARGE-MIR-NEXT: bb.1.entry:
171 ; 64LARGE-MIR-NEXT: successors: %bb.2(0x20000000), %bb.3(0x20000000), %bb.4(0x20000000), %bb.5(0x20000000)
172 ; 64LARGE-MIR-NEXT: liveins: $x3
173 ; 64LARGE-MIR-NEXT: {{ $}}
174 ; 64LARGE-MIR-NEXT: renamable $x3 = RLDIC killed renamable $x3, 2, 30
175 ; 64LARGE-MIR-NEXT: renamable $x4 = ADDIStocHA8 $x2, %jump-table.0
176 ; 64LARGE-MIR-NEXT: renamable $x4 = LDtocL %jump-table.0, killed renamable $x4, implicit $x2 :: (load (s64) from got)
177 ; 64LARGE-MIR-NEXT: renamable $x3 = LWAX killed renamable $x3, renamable $x4 :: (load (s32) from jump-table)
178 ; 64LARGE-MIR-NEXT: renamable $x3 = ADD8 killed renamable $x3, killed renamable $x4
179 ; 64LARGE-MIR-NEXT: MTCTR8 killed renamable $x3, implicit-def $ctr8
180 ; 64LARGE-MIR-NEXT: BCTR8 implicit $ctr8
181 ; 64LARGE-MIR-NEXT: {{ $}}
182 ; 64LARGE-MIR-NEXT: bb.2.sw.bb:
183 ; 64LARGE-MIR-NEXT: successors: %bb.6(0x80000000)
184 ; 64LARGE-MIR-NEXT: {{ $}}
185 ; 64LARGE-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
186 ; 64LARGE-MIR-NEXT: B %bb.6
187 ; 64LARGE-MIR-NEXT: {{ $}}
188 ; 64LARGE-MIR-NEXT: bb.3.sw.bb1:
189 ; 64LARGE-MIR-NEXT: successors: %bb.6(0x80000000)
190 ; 64LARGE-MIR-NEXT: {{ $}}
191 ; 64LARGE-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
192 ; 64LARGE-MIR-NEXT: B %bb.6
193 ; 64LARGE-MIR-NEXT: {{ $}}
194 ; 64LARGE-MIR-NEXT: bb.4.sw.bb2:
195 ; 64LARGE-MIR-NEXT: successors: %bb.6(0x80000000)
196 ; 64LARGE-MIR-NEXT: {{ $}}
197 ; 64LARGE-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
198 ; 64LARGE-MIR-NEXT: B %bb.6
199 ; 64LARGE-MIR-NEXT: {{ $}}
200 ; 64LARGE-MIR-NEXT: bb.5.sw.bb3:
201 ; 64LARGE-MIR-NEXT: successors: %bb.6(0x80000000)
202 ; 64LARGE-MIR-NEXT: {{ $}}
203 ; 64LARGE-MIR-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
204 ; 64LARGE-MIR-NEXT: {{ $}}
205 ; 64LARGE-MIR-NEXT: bb.6.sw.epilog:
206 ; 64LARGE-MIR-NEXT: $x3 = LI8 0
207 ; 64LARGE-MIR-NEXT: BLR8 implicit $lr8, implicit $rm, implicit $x3
209 switch i32 %a, label %sw.epilog [
217 tail call void asm sideeffect "", ""()
221 tail call void asm sideeffect "", ""()
225 tail call void asm sideeffect "", ""()
229 tail call void asm sideeffect "", ""()