Merge remote branch 'origin/master' into pipe-video
[mesa.git] / src / glsl / opt_copy_propagation.cpp
index 8d07fefbfd097e94124e6438600f1130a94656ff..efa3afda35aefe40f19e45bc8fe208b499aee1bc 100644 (file)
@@ -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);