Once the relevant branch has been identified do not iterate over the
instructions in the branch, do a linked list insertion instead to avoid the
loop.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* that matters out.
*/
if (condition_constant->value.b[0]) {
- foreach_list_safe(n, &ir->then_instructions) {
- ir_instruction *then_ir = (ir_instruction *) n;
- ir->insert_before(then_ir);
- }
+ ir->insert_before(&ir->then_instructions);
} else {
- foreach_list_safe(n, &ir->else_instructions) {
- ir_instruction *else_ir = (ir_instruction *) n;
- ir->insert_before(else_ir);
- }
+ ir->insert_before(&ir->else_instructions);
}
ir->remove();
this->made_progress = true;