all_parameters_are_constant = false;
if (result != ir) {
- ir->insert_before(result);
- ir->remove();
+ ir->replace_with(result);
}
}
ir_rvalue *new_ir = operand_to_temp(ir);
if (new_ir != ir) {
- ir->insert_before(new_ir);
- ir->remove();
+ ir->replace_with(new_ir);
}
}
if (ret) {
if (ret->value) {
ir_rvalue *lhs = new(ctx) ir_dereference_variable(retval);
- ret->insert_before(new(ctx) ir_assignment(lhs, ret->value, NULL));
- ret->remove();
+ ret->replace_with(new(ctx) ir_assignment(lhs, ret->value, NULL));
} else {
/* un-valued return has to be the last return, or we shouldn't
* have reached here. (see can_inline()).
assign = new(ir) ir_assignment(new(ir) ir_dereference_variable(new_var),
then_return->value, NULL);
- then_return->insert_before(assign);
- then_return->remove();
+ then_return->replace_with(assign);
assign = new(ir) ir_assignment(new(ir) ir_dereference_variable(new_var),
else_return->value, NULL);
- else_return->insert_before(assign);
- else_return->remove();
+ else_return->replace_with(assign);
ir_dereference_variable *deref = new(ir) ir_dereference_variable(new_var);
ir->insert_after(new(ir) ir_return(deref));
ir_rvalue *new_param = convert_vec_index_to_cond_assign(param);
if (new_param != param) {
- param->insert_before(new_param);
- param->remove();
+ param->replace_with(new_param);
}
}
ir_rvalue *new_param = convert_vec_index_to_swizzle(param);
if (new_param != param) {
- param->insert_before(new_param);
- param->remove();
+ param->replace_with(new_param);
}
}