1 ; RUN: llc -mtriple=spirv-unknown-vulkan-compute -O0 %s -o - | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan-compute %s -o - -filetype=obj | spirv-val %}
5 ; int foo() { return 200; }
7 ; [numthreads(1, 1, 1)]
11 ; ////////////////////////////
12 ; // The most basic case //
13 ; // Has a 'default' case //
14 ; // All cases have 'break' //
15 ; ////////////////////////////
35 ; ////////////////////////////////////
36 ; // The selector is a statement //
37 ; // Does not have a 'default' case //
38 ; // All cases have 'break' //
39 ; ////////////////////////////////////
50 ; ///////////////////////////////////
51 ; // All cases are fall-through //
52 ; // The last case is fall-through //
53 ; ///////////////////////////////////
61 ; ///////////////////////////////////////
62 ; // Some cases are fall-through //
63 ; // The last case is not fall-through //
64 ; ///////////////////////////////////////
79 ; ///////////////////////////////////////
80 ; // Fall-through cases with no body //
81 ; ///////////////////////////////////////
91 ; ////////////////////////////////////////////////
92 ; // No-op. Two nested cases and a nested break //
93 ; ////////////////////////////////////////////////
101 ; ////////////////////////////////////////////////////////////////
102 ; // Using braces (compound statements) in various parts //
103 ; // Using breaks such that each AST configuration is different //
104 ; // Also uses 'forcecase' attribute //
105 ; ////////////////////////////////////////////////////////////////
119 ; case 25: { result = 25; }
137 ; ////////////////////////////////////////////////////////////////////////
138 ; // Nested Switch statements with mixed use of fall-through and braces //
139 ; ////////////////////////////////////////////////////////////////////////
164 ; ///////////////////////////////////////////////
165 ; // Constant integer variables as case values //
166 ; ///////////////////////////////////////////////
170 ; const int t = 2*r + s; // evaluates to 115.
181 ; //////////////////////////////////////////////////////////////////
182 ; // Using float as selector results in multiple casts in the AST //
183 ; //////////////////////////////////////////////////////////////////
185 ; switch ((int)sel) {
192 ; CHECK: %[[#func_41:]] = OpFunction %[[#uint:]] DontInline %[[#]]
193 ; CHECK: %[[#bb82:]] = OpLabel
194 ; CHECK: OpReturnValue %[[#]]
195 ; CHECK: OpFunctionEnd
196 ; CHECK: %[[#func_42:]] = OpFunction %[[#void:]] DontInline %[[#]]
197 ; CHECK: %[[#bb83:]] = OpLabel
198 ; CHECK: OpSelectionMerge %[[#bb84:]] None
199 ; CHECK: OpSwitch %[[#]] %[[#bb85:]] 4294967293 %[[#bb86:]] 0 %[[#bb87:]] 1 %[[#bb88:]] 2 %[[#bb89:]]
200 ; CHECK: %[[#bb85:]] = OpLabel
201 ; CHECK: OpBranch %[[#bb84:]]
202 ; CHECK: %[[#bb86:]] = OpLabel
203 ; CHECK: OpBranch %[[#bb84:]]
204 ; CHECK: %[[#bb87:]] = OpLabel
205 ; CHECK: OpBranch %[[#bb84:]]
206 ; CHECK: %[[#bb88:]] = OpLabel
207 ; CHECK: OpBranch %[[#bb84:]]
208 ; CHECK: %[[#bb89:]] = OpLabel
209 ; CHECK: OpBranch %[[#bb84:]]
210 ; CHECK: %[[#bb84:]] = OpLabel
211 ; CHECK: OpSelectionMerge %[[#bb90:]] None
212 ; CHECK: OpSwitch %[[#]] %[[#bb90:]] 4294967292 %[[#bb91:]] 4 %[[#bb92:]]
213 ; CHECK: %[[#bb91:]] = OpLabel
214 ; CHECK: OpBranch %[[#bb90:]]
215 ; CHECK: %[[#bb92:]] = OpLabel
216 ; CHECK: OpBranch %[[#bb90:]]
217 ; CHECK: %[[#bb90:]] = OpLabel
218 ; CHECK: OpSelectionMerge %[[#bb93:]] None
219 ; CHECK: OpBranchConditional %[[#]] %[[#bb94:]] %[[#bb95:]]
220 ; CHECK: %[[#bb94:]] = OpLabel
221 ; CHECK: OpSelectionMerge %[[#bb96:]] None
222 ; CHECK: OpSwitch %[[#]] %[[#bb96:]] 4294967291 %[[#bb97:]] 5 %[[#bb98:]]
223 ; CHECK: %[[#bb95:]] = OpLabel
224 ; CHECK: %[[#bb97:]] = OpLabel
225 ; CHECK: OpBranch %[[#bb96:]]
226 ; CHECK: %[[#bb98:]] = OpLabel
227 ; CHECK: OpBranch %[[#bb96:]]
228 ; CHECK: %[[#bb96:]] = OpLabel
229 ; CHECK: OpBranchConditional %[[#]] %[[#bb93:]] %[[#bb99:]]
230 ; CHECK: %[[#bb99:]] = OpLabel
231 ; CHECK: OpBranch %[[#bb93:]]
232 ; CHECK: %[[#bb93:]] = OpLabel
233 ; CHECK: OpSelectionMerge %[[#bb100:]] None
234 ; CHECK: OpBranchConditional %[[#]] %[[#bb101:]] %[[#bb102:]]
235 ; CHECK: %[[#bb101:]] = OpLabel
236 ; CHECK: OpSelectionMerge %[[#bb103:]] None
237 ; CHECK: OpBranchConditional %[[#]] %[[#bb104:]] %[[#bb105:]]
238 ; CHECK: %[[#bb102:]] = OpLabel
239 ; CHECK: %[[#bb104:]] = OpLabel
240 ; CHECK: OpSelectionMerge %[[#bb106:]] None
241 ; CHECK: OpSwitch %[[#]] %[[#bb107:]] 6 %[[#bb108:]] 7 %[[#bb106:]] 8 %[[#bb109:]]
242 ; CHECK: %[[#bb105:]] = OpLabel
243 ; CHECK: %[[#bb107:]] = OpLabel
244 ; CHECK: OpBranch %[[#bb106:]]
245 ; CHECK: %[[#bb108:]] = OpLabel
246 ; CHECK: OpBranch %[[#bb106:]]
247 ; CHECK: %[[#bb109:]] = OpLabel
248 ; CHECK: OpBranch %[[#bb106:]]
249 ; CHECK: %[[#bb106:]] = OpLabel
250 ; CHECK: OpSelectionMerge %[[#bb110:]] None
251 ; CHECK: OpSwitch %[[#]] %[[#bb111:]] 1 %[[#bb110:]] 2 %[[#bb112:]]
252 ; CHECK: %[[#bb111:]] = OpLabel
253 ; CHECK: OpBranch %[[#bb110:]]
254 ; CHECK: %[[#bb112:]] = OpLabel
255 ; CHECK: OpBranch %[[#bb110:]]
256 ; CHECK: %[[#bb110:]] = OpLabel
257 ; CHECK: OpBranch %[[#bb103:]]
258 ; CHECK: %[[#bb103:]] = OpLabel
259 ; CHECK: OpBranchConditional %[[#]] %[[#bb113:]] %[[#bb100:]]
260 ; CHECK: %[[#bb113:]] = OpLabel
261 ; CHECK: OpBranch %[[#bb100:]]
262 ; CHECK: %[[#bb100:]] = OpLabel
263 ; CHECK: OpSelectionMerge %[[#bb114:]] None
264 ; CHECK: OpBranchConditional %[[#]] %[[#bb115:]] %[[#bb116:]]
265 ; CHECK: %[[#bb115:]] = OpLabel
266 ; CHECK: OpSelectionMerge %[[#bb117:]] None
267 ; CHECK: OpBranchConditional %[[#]] %[[#bb118:]] %[[#bb119:]]
268 ; CHECK: %[[#bb116:]] = OpLabel
269 ; CHECK: %[[#bb118:]] = OpLabel
270 ; CHECK: OpSelectionMerge %[[#bb120:]] None
271 ; CHECK: OpSwitch %[[#]] %[[#bb120:]] 10 %[[#bb121:]] 11 %[[#bb122:]] 12 %[[#bb123:]]
272 ; CHECK: %[[#bb119:]] = OpLabel
273 ; CHECK: %[[#bb121:]] = OpLabel
274 ; CHECK: OpBranch %[[#bb120:]]
275 ; CHECK: %[[#bb122:]] = OpLabel
276 ; CHECK: OpBranch %[[#bb120:]]
277 ; CHECK: %[[#bb123:]] = OpLabel
278 ; CHECK: OpBranch %[[#bb120:]]
279 ; CHECK: %[[#bb120:]] = OpLabel
280 ; CHECK: OpSelectionMerge %[[#bb124:]] None
281 ; CHECK: OpSwitch %[[#]] %[[#bb124:]] 1 %[[#bb125:]] 2 %[[#bb126:]]
282 ; CHECK: %[[#bb125:]] = OpLabel
283 ; CHECK: OpBranch %[[#bb124:]]
284 ; CHECK: %[[#bb126:]] = OpLabel
285 ; CHECK: OpBranch %[[#bb124:]]
286 ; CHECK: %[[#bb124:]] = OpLabel
287 ; CHECK: OpBranch %[[#bb117:]]
288 ; CHECK: %[[#bb117:]] = OpLabel
289 ; CHECK: OpBranch %[[#bb114:]]
290 ; CHECK: %[[#bb114:]] = OpLabel
291 ; CHECK: OpBranch %[[#bb127:]]
292 ; CHECK: %[[#bb127:]] = OpLabel
293 ; CHECK: OpSelectionMerge %[[#bb128:]] None
294 ; CHECK: OpBranchConditional %[[#]] %[[#bb129:]] %[[#bb130:]]
295 ; CHECK: %[[#bb129:]] = OpLabel
296 ; CHECK: OpSelectionMerge %[[#bb131:]] None
297 ; CHECK: OpSwitch %[[#]] %[[#bb131:]] 15 %[[#bb132:]] 16 %[[#bb133:]]
298 ; CHECK: %[[#bb130:]] = OpLabel
299 ; CHECK: %[[#bb132:]] = OpLabel
300 ; CHECK: OpBranch %[[#bb131:]]
301 ; CHECK: %[[#bb133:]] = OpLabel
302 ; CHECK: OpBranch %[[#bb131:]]
303 ; CHECK: %[[#bb131:]] = OpLabel
304 ; CHECK: OpBranch %[[#bb128:]]
305 ; CHECK: %[[#bb128:]] = OpLabel
306 ; CHECK: OpSelectionMerge %[[#bb134:]] None
307 ; CHECK: OpBranchConditional %[[#]] %[[#bb135:]] %[[#bb136:]]
308 ; CHECK: %[[#bb135:]] = OpLabel
309 ; CHECK: OpSelectionMerge %[[#bb137:]] None
310 ; CHECK: OpBranchConditional %[[#]] %[[#bb138:]] %[[#bb139:]]
311 ; CHECK: %[[#bb136:]] = OpLabel
312 ; CHECK: %[[#bb138:]] = OpLabel
313 ; CHECK: OpSelectionMerge %[[#bb140:]] None
314 ; CHECK: OpBranchConditional %[[#]] %[[#bb141:]] %[[#bb142:]]
315 ; CHECK: %[[#bb139:]] = OpLabel
316 ; CHECK: %[[#bb141:]] = OpLabel
317 ; CHECK: OpSelectionMerge %[[#bb143:]] None
318 ; CHECK: OpSwitch %[[#]] %[[#bb143:]] 20 %[[#bb144:]] 21 %[[#bb145:]] 22 %[[#bb146:]] 23 %[[#bb147:]] 24 %[[#bb148:]] 25 %[[#bb149:]] 26 %[[#bb150:]] 27 %[[#bb151:]] 28 %[[#bb152:]] 29 %[[#bb153:]]
319 ; CHECK: %[[#bb142:]] = OpLabel
320 ; CHECK: %[[#bb144:]] = OpLabel
321 ; CHECK: OpBranch %[[#bb143:]]
322 ; CHECK: %[[#bb145:]] = OpLabel
323 ; CHECK: OpBranch %[[#bb143:]]
324 ; CHECK: %[[#bb146:]] = OpLabel
325 ; CHECK: OpBranch %[[#bb143:]]
326 ; CHECK: %[[#bb147:]] = OpLabel
327 ; CHECK: OpBranch %[[#bb143:]]
328 ; CHECK: %[[#bb148:]] = OpLabel
329 ; CHECK: OpBranch %[[#bb143:]]
330 ; CHECK: %[[#bb149:]] = OpLabel
331 ; CHECK: OpBranch %[[#bb143:]]
332 ; CHECK: %[[#bb150:]] = OpLabel
333 ; CHECK: OpBranch %[[#bb143:]]
334 ; CHECK: %[[#bb151:]] = OpLabel
335 ; CHECK: OpBranch %[[#bb143:]]
336 ; CHECK: %[[#bb152:]] = OpLabel
337 ; CHECK: OpBranch %[[#bb143:]]
338 ; CHECK: %[[#bb153:]] = OpLabel
339 ; CHECK: OpBranch %[[#bb143:]]
340 ; CHECK: %[[#bb143:]] = OpLabel
341 ; CHECK: OpSelectionMerge %[[#bb154:]] None
342 ; CHECK: OpSwitch %[[#]] %[[#bb154:]] 1 %[[#bb155:]] 2 %[[#bb156:]] 3 %[[#bb157:]]
343 ; CHECK: %[[#bb155:]] = OpLabel
344 ; CHECK: OpBranch %[[#bb154:]]
345 ; CHECK: %[[#bb156:]] = OpLabel
346 ; CHECK: OpBranch %[[#bb154:]]
347 ; CHECK: %[[#bb157:]] = OpLabel
348 ; CHECK: OpBranch %[[#bb154:]]
349 ; CHECK: %[[#bb154:]] = OpLabel
350 ; CHECK: OpBranch %[[#bb140:]]
351 ; CHECK: %[[#bb140:]] = OpLabel
352 ; CHECK: OpSelectionMerge %[[#bb158:]] None
353 ; CHECK: OpSwitch %[[#]] %[[#bb158:]] 1 %[[#bb159:]] 2 %[[#bb160:]]
354 ; CHECK: %[[#bb159:]] = OpLabel
355 ; CHECK: OpBranch %[[#bb158:]]
356 ; CHECK: %[[#bb160:]] = OpLabel
357 ; CHECK: OpBranch %[[#bb158:]]
358 ; CHECK: %[[#bb158:]] = OpLabel
359 ; CHECK: OpBranch %[[#bb137:]]
360 ; CHECK: %[[#bb137:]] = OpLabel
361 ; CHECK: OpBranch %[[#bb134:]]
362 ; CHECK: %[[#bb134:]] = OpLabel
363 ; CHECK: OpSelectionMerge %[[#bb161:]] None
364 ; CHECK: OpBranchConditional %[[#]] %[[#bb162:]] %[[#bb161:]]
365 ; CHECK: %[[#bb162:]] = OpLabel
366 ; CHECK: OpSelectionMerge %[[#bb163:]] None
367 ; CHECK: OpBranchConditional %[[#]] %[[#bb164:]] %[[#bb165:]]
368 ; CHECK: %[[#bb164:]] = OpLabel
369 ; CHECK: OpSelectionMerge %[[#bb166:]] None
370 ; CHECK: OpBranchConditional %[[#]] %[[#bb167:]] %[[#bb168:]]
371 ; CHECK: %[[#bb165:]] = OpLabel
372 ; CHECK: %[[#bb167:]] = OpLabel
373 ; CHECK: OpSelectionMerge %[[#bb169:]] None
374 ; CHECK: OpBranchConditional %[[#]] %[[#bb170:]] %[[#bb171:]]
375 ; CHECK: %[[#bb168:]] = OpLabel
376 ; CHECK: %[[#bb170:]] = OpLabel
377 ; CHECK: OpSelectionMerge %[[#bb172:]] None
378 ; CHECK: OpSwitch %[[#]] %[[#bb173:]] 50 %[[#bb172:]] 51 %[[#bb174:]] 52 %[[#bb175:]] 53 %[[#bb176:]] 54 %[[#bb177:]]
379 ; CHECK: %[[#bb171:]] = OpLabel
380 ; CHECK: %[[#bb173:]] = OpLabel
381 ; CHECK: OpBranch %[[#bb172:]]
382 ; CHECK: %[[#bb174:]] = OpLabel
383 ; CHECK: OpBranch %[[#bb172:]]
384 ; CHECK: %[[#bb175:]] = OpLabel
385 ; CHECK: OpBranch %[[#bb172:]]
386 ; CHECK: %[[#bb176:]] = OpLabel
387 ; CHECK: OpBranch %[[#bb172:]]
388 ; CHECK: %[[#bb177:]] = OpLabel
389 ; CHECK: OpBranch %[[#bb172:]]
390 ; CHECK: %[[#bb172:]] = OpLabel
391 ; CHECK: OpSelectionMerge %[[#bb178:]] None
392 ; CHECK: OpSwitch %[[#]] %[[#bb179:]] 1 %[[#bb178:]] 2 %[[#bb180:]] 3 %[[#bb181:]]
393 ; CHECK: %[[#bb179:]] = OpLabel
394 ; CHECK: OpBranch %[[#bb178:]]
395 ; CHECK: %[[#bb180:]] = OpLabel
396 ; CHECK: OpBranch %[[#bb178:]]
397 ; CHECK: %[[#bb181:]] = OpLabel
398 ; CHECK: OpBranch %[[#bb178:]]
399 ; CHECK: %[[#bb178:]] = OpLabel
400 ; CHECK: OpBranch %[[#bb169:]]
401 ; CHECK: %[[#bb169:]] = OpLabel
402 ; CHECK: OpSelectionMerge %[[#bb182:]] None
403 ; CHECK: OpSwitch %[[#]] %[[#bb183:]] 1 %[[#bb182:]] 2 %[[#bb184:]]
404 ; CHECK: %[[#bb183:]] = OpLabel
405 ; CHECK: OpBranch %[[#bb182:]]
406 ; CHECK: %[[#bb184:]] = OpLabel
407 ; CHECK: OpBranch %[[#bb182:]]
408 ; CHECK: %[[#bb182:]] = OpLabel
409 ; CHECK: OpBranch %[[#bb166:]]
410 ; CHECK: %[[#bb166:]] = OpLabel
411 ; CHECK: OpBranchConditional %[[#]] %[[#bb185:]] %[[#bb163:]]
412 ; CHECK: %[[#bb185:]] = OpLabel
413 ; CHECK: OpBranch %[[#bb163:]]
414 ; CHECK: %[[#bb163:]] = OpLabel
415 ; CHECK: OpBranch %[[#bb161:]]
416 ; CHECK: %[[#bb161:]] = OpLabel
417 ; CHECK: OpSelectionMerge %[[#bb186:]] None
418 ; CHECK: OpBranchConditional %[[#]] %[[#bb187:]] %[[#bb188:]]
419 ; CHECK: %[[#bb187:]] = OpLabel
420 ; CHECK: OpSelectionMerge %[[#bb189:]] None
421 ; CHECK: OpSwitch %[[#]] %[[#bb189:]] 35 %[[#bb190:]] 115 %[[#bb191:]]
422 ; CHECK: %[[#bb188:]] = OpLabel
423 ; CHECK: %[[#bb190:]] = OpLabel
424 ; CHECK: OpBranch %[[#bb189:]]
425 ; CHECK: %[[#bb191:]] = OpLabel
426 ; CHECK: OpBranch %[[#bb189:]]
427 ; CHECK: %[[#bb189:]] = OpLabel
428 ; CHECK: OpBranchConditional %[[#]] %[[#bb186:]] %[[#bb192:]]
429 ; CHECK: %[[#bb192:]] = OpLabel
430 ; CHECK: OpBranch %[[#bb186:]]
431 ; CHECK: %[[#bb186:]] = OpLabel
432 ; CHECK: OpSelectionMerge %[[#bb193:]] None
433 ; CHECK: OpBranchConditional %[[#]] %[[#bb194:]] %[[#bb193:]]
434 ; CHECK: %[[#bb194:]] = OpLabel
435 ; CHECK: OpBranch %[[#bb193:]]
436 ; CHECK: %[[#bb193:]] = OpLabel
438 ; CHECK: OpFunctionEnd
439 ; CHECK: %[[#func_80:]] = OpFunction %[[#void:]] None %[[#]]
440 ; CHECK: %[[#bb195:]] = OpLabel
442 ; CHECK: OpFunctionEnd
446 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-G1"
447 target triple = "spirv-unknown-vulkan1.3-compute"
449 ; Function Attrs: convergent noinline norecurse nounwind optnone
450 define spir_func noundef i32 @_Z3foov() #0 {
452 %0 = call token @llvm.experimental.convergence.entry()
456 ; Function Attrs: convergent nocallback nofree nosync nounwind willreturn memory(none)
457 declare token @llvm.experimental.convergence.entry() #1
459 ; Function Attrs: convergent noinline norecurse nounwind optnone
460 define internal spir_func void @main() #0 {
462 %0 = call token @llvm.experimental.convergence.entry()
463 %result = alloca i32, align 4
464 %a = alloca i32, align 4
465 %c = alloca i32, align 4
466 %r = alloca i32, align 4
467 %s = alloca i32, align 4
468 %t = alloca i32, align 4
469 %sel = alloca float, align 4
470 store i32 0, ptr %a, align 4
471 %1 = load i32, ptr %a, align 4
472 switch i32 %1, label %sw.default [
479 sw.bb: ; preds = %entry
480 store i32 -300, ptr %result, align 4
483 sw.bb1: ; preds = %entry
484 store i32 0, ptr %result, align 4
487 sw.bb2: ; preds = %entry
488 store i32 100, ptr %result, align 4
491 sw.bb3: ; preds = %entry
492 %call4 = call spir_func noundef i32 @_Z3foov() #3 [ "convergencectrl"(token %0) ]
493 store i32 %call4, ptr %result, align 4
496 sw.default: ; preds = %entry
497 store i32 777, ptr %result, align 4
500 sw.epilog: ; preds = %sw.default, %sw.bb3, %sw.bb2, %sw.bb1, %sw.bb
501 %2 = load i32, ptr %a, align 4
502 store i32 %2, ptr %c, align 4
503 %3 = load i32, ptr %c, align 4
504 switch i32 %3, label %sw.epilog7 [
505 i32 -4, label %sw.bb5
509 sw.bb5: ; preds = %sw.epilog
510 store i32 -400, ptr %result, align 4
513 sw.bb6: ; preds = %sw.epilog
514 store i32 400, ptr %result, align 4
517 sw.epilog7: ; preds = %sw.epilog, %sw.bb6, %sw.bb5
518 %4 = load i32, ptr %a, align 4
519 switch i32 %4, label %sw.epilog10 [
520 i32 -5, label %sw.bb8
524 sw.bb8: ; preds = %sw.epilog7
525 store i32 -500, ptr %result, align 4
528 sw.bb9: ; preds = %sw.epilog7, %sw.bb8
529 store i32 500, ptr %result, align 4
530 br label %sw.epilog10
532 sw.epilog10: ; preds = %sw.bb9, %sw.epilog7
533 %5 = load i32, ptr %a, align 4
534 switch i32 %5, label %sw.default14 [
535 i32 6, label %sw.bb11
536 i32 7, label %sw.bb12
537 i32 8, label %sw.bb13
540 sw.bb11: ; preds = %sw.epilog10
541 store i32 600, ptr %result, align 4
544 sw.bb12: ; preds = %sw.epilog10, %sw.bb11
545 store i32 700, ptr %result, align 4
548 sw.bb13: ; preds = %sw.epilog10, %sw.bb12
549 store i32 800, ptr %result, align 4
550 br label %sw.epilog15
552 sw.default14: ; preds = %sw.epilog10
553 store i32 777, ptr %result, align 4
554 br label %sw.epilog15
556 sw.epilog15: ; preds = %sw.default14, %sw.bb13
557 %6 = load i32, ptr %a, align 4
558 switch i32 %6, label %sw.default17 [
559 i32 10, label %sw.bb16
560 i32 11, label %sw.bb16
561 i32 12, label %sw.bb18
564 sw.bb16: ; preds = %sw.epilog15, %sw.epilog15
565 br label %sw.default17
567 sw.default17: ; preds = %sw.epilog15, %sw.bb16
570 sw.bb18: ; preds = %sw.epilog15, %sw.default17
571 store i32 12, ptr %result, align 4
572 br label %sw.epilog19
574 sw.epilog19: ; preds = %sw.bb18
575 %7 = load i32, ptr %a, align 4
576 switch i32 %7, label %sw.epilog21 [
577 i32 15, label %sw.bb20
578 i32 16, label %sw.bb20
581 sw.bb20: ; preds = %sw.epilog19, %sw.epilog19
582 br label %sw.epilog21
584 sw.epilog21: ; preds = %sw.epilog19, %sw.bb20
585 %8 = load i32, ptr %a, align 4
586 switch i32 %8, label %sw.epilog29 [
587 i32 20, label %sw.bb22
588 i32 21, label %sw.bb23
589 i32 22, label %sw.bb24
590 i32 23, label %sw.bb24
591 i32 24, label %sw.bb25
592 i32 25, label %sw.bb25
593 i32 26, label %sw.bb26
594 i32 27, label %sw.bb26
595 i32 28, label %sw.bb27
596 i32 29, label %sw.bb28
599 sw.bb22: ; preds = %sw.epilog21
600 store i32 20, ptr %result, align 4
601 br label %sw.epilog29
603 sw.bb23: ; preds = %sw.epilog21
604 store i32 21, ptr %result, align 4
605 br label %sw.epilog29
607 sw.bb24: ; preds = %sw.epilog21, %sw.epilog21
608 br label %sw.epilog29
610 sw.bb25: ; preds = %sw.epilog21, %sw.epilog21
611 store i32 25, ptr %result, align 4
612 br label %sw.epilog29
614 sw.bb26: ; preds = %sw.epilog21, %sw.epilog21
615 br label %sw.epilog29
617 sw.bb27: ; preds = %sw.epilog21
618 store i32 28, ptr %result, align 4
619 br label %sw.epilog29
621 sw.bb28: ; preds = %sw.epilog21
622 store i32 29, ptr %result, align 4
623 br label %sw.epilog29
625 sw.epilog29: ; preds = %sw.epilog21, %sw.bb28, %sw.bb27, %sw.bb26, %sw.bb25, %sw.bb24, %sw.bb23, %sw.bb22
626 %9 = load i32, ptr %a, align 4
627 switch i32 %9, label %sw.epilog37 [
628 i32 30, label %sw.bb30
631 sw.bb30: ; preds = %sw.epilog29
632 store i32 30, ptr %result, align 4
633 %10 = load i32, ptr %result, align 4
634 switch i32 %10, label %sw.default31 [
635 i32 50, label %sw.bb32
636 i32 51, label %sw.bb33
637 i32 52, label %sw.bb33
638 i32 53, label %sw.bb34
639 i32 54, label %sw.bb35
642 sw.default31: ; preds = %sw.bb30
643 store i32 55, ptr %a, align 4
646 sw.bb32: ; preds = %sw.bb30, %sw.default31
647 store i32 50, ptr %a, align 4
648 br label %sw.epilog36
650 sw.bb33: ; preds = %sw.bb30, %sw.bb30
651 store i32 52, ptr %a, align 4
654 sw.bb34: ; preds = %sw.bb30, %sw.bb33
655 store i32 53, ptr %a, align 4
656 br label %sw.epilog36
658 sw.bb35: ; preds = %sw.bb30
659 store i32 54, ptr %a, align 4
660 br label %sw.epilog36
662 sw.epilog36: ; preds = %sw.bb35, %sw.bb34, %sw.bb32
663 br label %sw.epilog37
665 sw.epilog37: ; preds = %sw.epilog36, %sw.epilog29
666 store i32 35, ptr %r, align 4
667 store i32 45, ptr %s, align 4
668 store i32 115, ptr %t, align 4
669 %11 = load i32, ptr %a, align 4
670 switch i32 %11, label %sw.epilog40 [
671 i32 35, label %sw.bb38
672 i32 115, label %sw.bb39
675 sw.bb38: ; preds = %sw.epilog37
676 store i32 35, ptr %result, align 4
679 sw.bb39: ; preds = %sw.epilog37, %sw.bb38
680 store i32 115, ptr %result, align 4
681 br label %sw.epilog40
683 sw.epilog40: ; preds = %sw.epilog37, %sw.bb39
684 %12 = load float, ptr %sel, align 4
685 %conv = fptosi float %12 to i32
686 switch i32 %conv, label %sw.epilog42 [
687 i32 0, label %sw.bb41
690 sw.bb41: ; preds = %sw.epilog40
691 store i32 0, ptr %result, align 4
692 br label %sw.epilog42
694 sw.epilog42: ; preds = %sw.epilog40, %sw.bb41
698 ; Function Attrs: convergent norecurse
699 define void @main.1() #2 {
705 attributes #0 = { convergent noinline norecurse nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
706 attributes #1 = { convergent nocallback nofree nosync nounwind willreturn memory(none) }
707 attributes #2 = { convergent norecurse "frame-pointer"="all" "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
708 attributes #3 = { convergent }
710 !llvm.module.flags = !{!0, !1, !2}
713 !0 = !{i32 1, !"wchar_size", i32 4}
714 !1 = !{i32 4, !"dx.disable_optimizations", i32 1}
715 !2 = !{i32 7, !"frame-pointer", i32 2}