X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglsl%2Fopt_copy_propagation.cpp;h=efa3afda35aefe40f19e45bc8fe208b499aee1bc;hb=b922a0ce12916a91cfc3e56714913fcf63279ff2;hp=8d07fefbfd097e94124e6438600f1130a94656ff;hpb=e6b71530daea3059ee362d4df51575e27e026b22;p=mesa.git diff --git a/src/glsl/opt_copy_propagation.cpp b/src/glsl/opt_copy_propagation.cpp index 8d07fefbfd0..efa3afda35a 100644 --- a/src/glsl/opt_copy_propagation.cpp +++ b/src/glsl/opt_copy_propagation.cpp @@ -71,13 +71,13 @@ public: ir_copy_propagation_visitor() { progress = false; - mem_ctx = talloc_new(0); + mem_ctx = ralloc_context(0); this->acp = new(mem_ctx) exec_list; this->kills = new(mem_ctx) exec_list; } ~ir_copy_propagation_visitor() { - talloc_free(mem_ctx); + ralloc_free(mem_ctx); } virtual ir_visitor_status visit(class ir_dereference_variable *); @@ -191,7 +191,7 @@ ir_copy_propagation_visitor::visit_enter(ir_call *ir) sig_param_iter.next(); } - /* Since we're unlinked, we don't (necssarily) know the side effects of + /* Since we're unlinked, we don't (necessarily) know the side effects of * this call. So kill all copies. */ acp->make_empty(); @@ -309,11 +309,8 @@ ir_copy_propagation_visitor::add_copy(ir_assignment *ir) { acp_entry *entry; - if (ir->condition) { - ir_constant *condition = ir->condition->as_constant(); - if (!condition || !condition->value.b[0]) - return; - } + if (ir->condition) + return; ir_variable *lhs_var = ir->whole_variable_written(); ir_variable *rhs_var = ir->rhs->whole_variable_referenced(); @@ -325,7 +322,7 @@ ir_copy_propagation_visitor::add_copy(ir_assignment *ir) * calling us. Just flag it to not execute, and someone else * will clean up the mess. */ - ir->condition = new(talloc_parent(ir)) ir_constant(false); + ir->condition = new(ralloc_parent(ir)) ir_constant(false); this->progress = true; } else { entry = new(this->mem_ctx) acp_entry(lhs_var, rhs_var);