|
71 | 71 | return %8 : $()
|
72 | 72 | }
|
73 | 73 |
|
| 74 | +// CHECK-LABEL: sil @loop_unroll_3 |
| 75 | +// CHECK: bb0: |
| 76 | +// CHECK: br bb1 |
| 77 | +// CHECK: bb1 |
| 78 | +// CHECK: = builtin "sadd_with_overflow_Int64 |
| 79 | +// CHECK: cond_br {{.*}}, bb3, bb2 |
| 80 | +// CHECK: bb2: |
| 81 | +// CHECK: br bb4 |
| 82 | +// CHECK: bb3: |
| 83 | +// CHECK: return |
| 84 | +// CHECK: bb4 |
| 85 | +// CHECK: = builtin "sadd_with_overflow_Int64 |
| 86 | +// CHECK: br bb3 |
| 87 | + |
| 88 | +sil @loop_unroll_3 : $@convention(thin) () -> () { |
| 89 | +bb0: |
| 90 | + %0 = integer_literal $Builtin.Int64, 0 |
| 91 | + %1 = integer_literal $Builtin.Int64, 1 |
| 92 | + %2 = integer_literal $Builtin.Int64, 2 |
| 93 | + %3 = integer_literal $Builtin.Int1, 1 |
| 94 | + br bb1(%0 : $Builtin.Int64) |
| 95 | + |
| 96 | +bb1(%4 : $Builtin.Int64): |
| 97 | + %5 = builtin "sadd_with_overflow_Int64"(%4 : $Builtin.Int64, %1 : $Builtin.Int64, %3 : $Builtin.Int1) : $(Builtin.Int64, Builtin.Int1) |
| 98 | + %6 = tuple_extract %5 : $(Builtin.Int64, Builtin.Int1), 0 |
| 99 | + %7 = builtin "cmp_sge_Int64"(%6 : $Builtin.Int64, %2 : $Builtin.Int64) : $Builtin.Int1 |
| 100 | + cond_br %7, bb3, bb2 |
| 101 | + |
| 102 | +bb2: |
| 103 | + br bb1(%6 : $Builtin.Int64) |
| 104 | + |
| 105 | +bb3: |
| 106 | + %8 = tuple() |
| 107 | + return %8 : $() |
| 108 | +} |
| 109 | + |
| 110 | +// CHECK-LABEL: sil @loop_unroll_4 |
| 111 | +// CHECK: bb0: |
| 112 | +// CHECK: br bb1 |
| 113 | +// CHECK: bb1 |
| 114 | +// CHECK: = builtin "sadd_with_overflow_Int64 |
| 115 | +// CHECK: cond_br {{.*}}, bb3, bb2 |
| 116 | +// CHECK: bb2: |
| 117 | +// CHECK: br bb4 |
| 118 | +// CHECK: bb3: |
| 119 | +// CHECK: return |
| 120 | +// CHECK: bb4 |
| 121 | +// CHECK: = builtin "sadd_with_overflow_Int64 |
| 122 | +// CHECK: br bb3 |
| 123 | + |
| 124 | +sil @loop_unroll_4 : $@convention(thin) () -> () { |
| 125 | +bb0: |
| 126 | + %0 = integer_literal $Builtin.Int64, 0 |
| 127 | + %1 = integer_literal $Builtin.Int64, 1 |
| 128 | + %2 = integer_literal $Builtin.Int64, 1 |
| 129 | + %3 = integer_literal $Builtin.Int1, 1 |
| 130 | + br bb1(%0 : $Builtin.Int64) |
| 131 | + |
| 132 | +bb1(%4 : $Builtin.Int64): |
| 133 | + %5 = builtin "sadd_with_overflow_Int64"(%4 : $Builtin.Int64, %1 : $Builtin.Int64, %3 : $Builtin.Int1) : $(Builtin.Int64, Builtin.Int1) |
| 134 | + %6 = tuple_extract %5 : $(Builtin.Int64, Builtin.Int1), 0 |
| 135 | + %7 = builtin "cmp_sgt_Int64"(%6 : $Builtin.Int64, %2 : $Builtin.Int64) : $Builtin.Int1 |
| 136 | + cond_br %7, bb3, bb2 |
| 137 | + |
| 138 | +bb2: |
| 139 | + br bb1(%6 : $Builtin.Int64) |
| 140 | + |
| 141 | +bb3: |
| 142 | + %8 = tuple() |
| 143 | + return %8 : $() |
| 144 | +} |
| 145 | + |
74 | 146 | class B {}
|
75 | 147 |
|
76 | 148 | // CHECK-LABEL: sil @unroll_with_stack_allocation
|
|
0 commit comments