Variables may get assigned in the loop and the next iteration needs to
read those values, not the cached pre-loop values.
This could be done better by only clearing loads for the variables which
are actually assigned in the loop, but I'm not sure how exactly I want
to do that.
if(iter.init_statement)
iter.init_statement->visit(*this);
+ variable_load_ids.clear();
+
Id header_id = next_id++;
Id continue_id = next_id++;
Id merge_block_id = next_id++;
writer.write_op(content.function_body, OP_BRANCH, header_id);
writer.write_op_label(merge_block_id);
- prune_loads(header_id);
reachable = true;
}