1 ; RUN: llc %s -O2 -print-after-isel -mtriple=aarch64-linux-gnu -jump-table-density=40 -aarch64-min-jump-table-entries=0 -o /dev/null 2> %t; FileCheck %s --check-prefixes=CHECK,CHECK0 < %t
2 ; RUN: llc %s -O2 -print-after-isel -mtriple=aarch64-linux-gnu -jump-table-density=40 -aarch64-min-jump-table-entries=2 -o /dev/null 2> %t; FileCheck %s --check-prefixes=CHECK,CHECK2 < %t
3 ; RUN: llc %s -O2 -print-after-isel -mtriple=aarch64-linux-gnu -jump-table-density=40 -aarch64-min-jump-table-entries=4 -o /dev/null 2> %t; FileCheck %s --check-prefixes=CHECK,CHECK4 < %t
4 ; RUN: llc %s -O2 -print-after-isel -mtriple=aarch64-linux-gnu -jump-table-density=40 -aarch64-min-jump-table-entries=8 -o /dev/null 2> %t; FileCheck %s --check-prefixes=CHECK,CHECK8 < %t
5 ; RUN: llc %s -O2 -print-after-isel -mtriple=aarch64-linux-gnu -jump-table-density=40 -aarch64-min-jump-table-entries=12 -o /dev/null 2> %t; FileCheck %s --check-prefixes=CHECK,CHECK12 < %t
6 ; RUN: llc %s -O2 -print-after-isel -mtriple=aarch64-linux-gnu -jump-table-density=40 -o /dev/null 2> %t; FileCheck %s --check-prefixes=CHECK,CHECK-DEFAULT < %t
8 declare void @ext(i32, i32)
10 define i32 @jt2(i32 %a, i32 %b) {
12 switch i32 %a, label %return [
16 ; CHECK-LABEL: function jt2:
17 ; CHECK0-NEXT: Jump Tables:
18 ; CHECK2-NEXT: Jump Tables:
19 ; CHECK4-NOT: {{^}}Jump Tables:
20 ; CHECK8-NOT: {{^}}Jump Tables:
21 ; CHECK12-NOT: {{^}}Jump Tables:
22 ; CHECK-DEFAULT-NOT: {{^}}Jump Tables:
24 bb1: tail call void @ext(i32 1, i32 0) br label %return
25 bb2: tail call void @ext(i32 2, i32 2) br label %return
30 define i32 @jt4(i32 %a, i32 %b) {
32 switch i32 %a, label %return [
38 ; CHECK-LABEL: function jt4:
39 ; CHECK0-NEXT: Jump Tables:
40 ; CHECK2-NEXT: Jump Tables:
41 ; CHECK4-NEXT: Jump Tables:
42 ; CHECK8-NOT: {{^}}Jump Tables:
43 ; CHECK12-NOT: {{^}}Jump Tables:
44 ; CHECK-DEFAULT-NOT: {{^}}Jump Tables:
46 bb1: tail call void @ext(i32 1, i32 0) br label %return
47 bb2: tail call void @ext(i32 3, i32 2) br label %return
48 bb3: tail call void @ext(i32 4, i32 4) br label %return
49 bb4: tail call void @ext(i32 5, i32 6) br label %return
54 define i32 @jt8(i32 %a, i32 %b) {
56 switch i32 %a, label %return [
66 ; CHECK-LABEL: function jt8:
67 ; CHECK0-NEXT: Jump Tables:
68 ; CHECK2-NEXT: Jump Tables:
69 ; CHECK4-NEXT: Jump Tables:
70 ; CHECK8-NEXT: Jump Tables:
71 ; CHECK12-NOT: Jump Tables:
72 ; CHECK-DEFAULT-NOT: {{^}}Jump Tables:
74 bb1: tail call void @ext(i32 1, i32 0) br label %return
75 bb2: tail call void @ext(i32 2, i32 2) br label %return
76 bb3: tail call void @ext(i32 3, i32 4) br label %return
77 bb4: tail call void @ext(i32 4, i32 6) br label %return
78 bb5: tail call void @ext(i32 5, i32 8) br label %return
79 bb6: tail call void @ext(i32 6, i32 10) br label %return
80 bb7: tail call void @ext(i32 7, i32 12) br label %return
81 bb8: tail call void @ext(i32 8, i32 14) br label %return
86 define i32 @jt12(i32 %a, i32 %b) {
88 switch i32 %a, label %return [
102 ; CHECK-LABEL: function jt12:
103 ; CHECK0-NEXT: Jump Tables:
104 ; CHECK2-NEXT: Jump Tables:
105 ; CHECK4-NEXT: Jump Tables:
106 ; CHECK8-NEXT: Jump Tables:
107 ; CHECK12-NEXT: Jump Tables:
108 ; CHECK-DEFAULT-NOT: {{^}}Jump Tables:
110 bb1: tail call void @ext(i32 1, i32 0) br label %return
111 bb2: tail call void @ext(i32 2, i32 2) br label %return
112 bb3: tail call void @ext(i32 3, i32 4) br label %return
113 bb4: tail call void @ext(i32 4, i32 6) br label %return
114 bb5: tail call void @ext(i32 5, i32 8) br label %return
115 bb6: tail call void @ext(i32 6, i32 10) br label %return
116 bb7: tail call void @ext(i32 7, i32 12) br label %return
117 bb8: tail call void @ext(i32 8, i32 14) br label %return
118 bb9: tail call void @ext(i32 9, i32 16) br label %return
119 bb10: tail call void @ext(i32 10, i32 18) br label %return
120 bb11: tail call void @ext(i32 11, i32 20) br label %return
121 bb12: tail call void @ext(i32 12, i32 22) br label %return
126 define i32 @jt12_min_size(i32 %a, i32 %b) minsize {
128 switch i32 %a, label %return [
142 ; CHECK-LABEL: function jt12_min_size:
143 ; CHECK0-NEXT: Jump Tables:
144 ; CHECK2-NEXT: Jump Tables:
145 ; CHECK4-NEXT: Jump Tables:
146 ; CHECK8-NEXT: Jump Tables:
147 ; CHECK12-NEXT: Jump Tables:
148 ; CHECK-DEFAULT: Jump Tables:
150 bb1: tail call void @ext(i32 1, i32 0) br label %return
151 bb2: tail call void @ext(i32 2, i32 2) br label %return
152 bb3: tail call void @ext(i32 3, i32 4) br label %return
153 bb4: tail call void @ext(i32 4, i32 6) br label %return
154 bb5: tail call void @ext(i32 5, i32 8) br label %return
155 bb6: tail call void @ext(i32 6, i32 10) br label %return
156 bb7: tail call void @ext(i32 7, i32 12) br label %return
157 bb8: tail call void @ext(i32 8, i32 14) br label %return
158 bb9: tail call void @ext(i32 9, i32 16) br label %return
159 bb10: tail call void @ext(i32 10, i32 18) br label %return
160 bb11: tail call void @ext(i32 11, i32 20) br label %return
161 bb12: tail call void @ext(i32 12, i32 22) br label %return
166 define i32 @jt13(i32 %a, i32 %b) {
168 switch i32 %a, label %return [
183 ; CHECK-LABEL: function jt13:
184 ; CHECK-NEXT: Jump Tables:
186 bb1: tail call void @ext(i32 1, i32 0) br label %return
187 bb2: tail call void @ext(i32 2, i32 2) br label %return
188 bb3: tail call void @ext(i32 3, i32 4) br label %return
189 bb4: tail call void @ext(i32 4, i32 6) br label %return
190 bb5: tail call void @ext(i32 5, i32 8) br label %return
191 bb6: tail call void @ext(i32 6, i32 10) br label %return
192 bb7: tail call void @ext(i32 7, i32 12) br label %return
193 bb8: tail call void @ext(i32 8, i32 14) br label %return
194 bb9: tail call void @ext(i32 9, i32 16) br label %return
195 bb10: tail call void @ext(i32 10, i32 18) br label %return
196 bb11: tail call void @ext(i32 11, i32 20) br label %return
197 bb12: tail call void @ext(i32 12, i32 22) br label %return
198 bb13: tail call void @ext(i32 13, i32 24) br label %return