@@ -441,6 +441,67 @@ bb3:
441
441
return %23 : $Int32
442
442
}
443
443
444
+ // HOIST-LABEL: sil @always_false_hoist
445
+ // HOIST: bb4
446
+ // HOIST: builtin "sadd_with_overflow_Int32"
447
+ // HOIST: tuple_extract
448
+ // HOIST-NOT: builtin "cmp_slt_Int32"
449
+ // HOIST-NOT: builtin "cmp_sle_Int32"
450
+ // HOIST-NOT: builtin "cmp_eq_Int32"
451
+ // HOIST: cond_fail
452
+ // HOIST: cond_fail
453
+ // HOIST: cond_fail
454
+ // HOIST: cond_fail
455
+ // HOIST: builtin "cmp_eq_Int32"
456
+ // HOIST: cond_br
457
+ // HOIST: }
458
+ sil @always_false_hoist : $@convention(thin) (@owned Array<Int>) -> () {
459
+ bb0(%0 : $Array<Int>):
460
+ %z0 = integer_literal $Builtin.Int32, 0
461
+ %f1 = function_ref @getCount2 : $@convention(method) (@owned Array<Int>) -> Int32
462
+ retain_value %0 : $Array<Int>
463
+ %t1 = apply %f1(%0) : $@convention(method) (@owned Array<Int>) -> Int32
464
+ %c1 = struct_extract %t1 : $Int32, #Int32._value
465
+ %t2 = builtin "cmp_eq_Int32"(%z0 : $Builtin.Int32, %c1 : $Builtin.Int32) : $Builtin.Int1
466
+ cond_br %t2, bb5, bb1
467
+
468
+ bb1:
469
+ br bb2(%z0 : $Builtin.Int32)
470
+
471
+ bb2(%i0 : $Builtin.Int32):
472
+ cond_br undef, bb3, bb4
473
+
474
+ bb3:
475
+ %f2 = function_ref @checkbounds2 : $@convention(method) (Int32, Bool, @owned Array<Int>) -> _DependenceToken
476
+ retain_value %0 : $Array<Int>
477
+ %t3 = struct $Int32(%i0 : $Builtin.Int32)
478
+
479
+ br bb4
480
+
481
+ bb4:
482
+ %t5 = integer_literal $Builtin.Int1, 0
483
+ %i2 = integer_literal $Builtin.Int32, 1
484
+ %t6 = builtin "sadd_with_overflow_Int32"(%i0 : $Builtin.Int32, %i2 : $Builtin.Int32, %t5 : $Builtin.Int1) : $(Builtin.Int32, Builtin.Int1)
485
+ %t7 = tuple_extract %t6 : $(Builtin.Int32, Builtin.Int1), 0
486
+ %t8 = tuple_extract %t6 : $(Builtin.Int32, Builtin.Int1), 1
487
+ cond_fail %t8 : $Builtin.Int1
488
+ %af1 = builtin "cmp_slt_Int32"(%i0 : $Builtin.Int32, %z0 : $Builtin.Int32) : $Builtin.Int1
489
+ cond_fail %af1 : $Builtin.Int1
490
+ %af2 = builtin "cmp_slt_Int32"(%t7 : $Builtin.Int32, %z0 : $Builtin.Int32) : $Builtin.Int1
491
+ cond_fail %af2 : $Builtin.Int1
492
+ %af3 = builtin "cmp_sle_Int32"(%t7 : $Builtin.Int32, %z0 : $Builtin.Int32) : $Builtin.Int1
493
+ cond_fail %af3 : $Builtin.Int1
494
+ %af4 = builtin "cmp_eq_Int32"(%t7 : $Builtin.Int32, %z0 : $Builtin.Int32) : $Builtin.Int1
495
+ cond_fail %af4 : $Builtin.Int1
496
+ %8 = builtin "cmp_eq_Int32"(%t7 : $Builtin.Int32, %c1 : $Builtin.Int32) : $Builtin.Int1
497
+ cond_br %8, bb5, bb2(%t7 : $Builtin.Int32)
498
+
499
+ bb5:
500
+ %r1 = tuple ()
501
+ return %r1 : $()
502
+ }
503
+
504
+
444
505
// HOIST-LABEL: sil @hoistinvariant
445
506
446
507
// Preheader.
0 commit comments