| ... | @@ -3205,14 +3205,11 @@ fn zirValidateArrayInit( | ... | @@ -3205,14 +3205,11 @@ fn zirValidateArrayInit( |
| 3205 | // instruction after it within the same block. | 3205 | // instruction after it within the same block. |
| 3206 | // Possible performance enhancement: save the `block_index` between iterations | 3206 | // Possible performance enhancement: save the `block_index` between iterations |
| 3207 | // of the for loop. | 3207 | // of the for loop. |
| 3208 | const next_air_inst = inst: { | 3208 | var block_index = block.instructions.items.len - 1; |
| 3209 | var block_index = block.instructions.items.len - 1; | 3209 | while (block.instructions.items[block_index] != elem_ptr_air_inst) { |
| 3210 | while (block.instructions.items[block_index] != elem_ptr_air_inst) { | 3210 | block_index -= 1; |
| 3211 | block_index -= 1; | 3211 | } |
| 3212 | } | 3212 | first_block_index = @minimum(first_block_index, block_index); |
| 3213 | first_block_index = @minimum(first_block_index, block_index); | | |
| 3214 | break :inst block.instructions.items[block_index + 1]; | | |
| 3215 | }; | | |
| 3216 | | 3213 | |
| 3217 | // Array has one possible value, so value is always comptime-known | 3214 | // Array has one possible value, so value is always comptime-known |
| 3218 | if (opt_opv) |opv| { | 3215 | if (opt_opv) |opv| { |
| ... | @@ -3222,6 +3219,7 @@ fn zirValidateArrayInit( | ... | @@ -3222,6 +3219,7 @@ fn zirValidateArrayInit( |
| 3222 | | 3219 | |
| 3223 | // If the next instructon is a store with a comptime operand, this element | 3220 | // If the next instructon is a store with a comptime operand, this element |
| 3224 | // is comptime. | 3221 | // is comptime. |
| | 3222 | const next_air_inst = block.instructions.items[block_index + 1]; |
| 3225 | switch (air_tags[next_air_inst]) { | 3223 | switch (air_tags[next_air_inst]) { |
| 3226 | .store => { | 3224 | .store => { |
| 3227 | const bin_op = air_datas[next_air_inst].bin_op; | 3225 | const bin_op = air_datas[next_air_inst].bin_op; |