summaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_copy_propagation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/opt_copy_propagation.cpp')
-rw-r--r--src/glsl/opt_copy_propagation.cpp15
1 files changed, 6 insertions, 9 deletions
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);