[Mesa-dev] [PATCH 04/10] glsl: separate copy propagation state

Caio Marcelo de Oliveira Filho caio.oliveira at intel.com
Mon Jul 9 18:03:57 UTC 2018


> Since this copy_propagation_state covers just the acp and not the kills
> list (whcih is still part of the copy propagation state in the visitor
> class), could we call it "acp"?

I'm considering moving the kills list inside that state, hence the
more general name.


> > @@ -191,26 +283,21 @@ ir_copy_propagation_elements_visitor::visit_enter(ir_function_signature *ir)
> >     exec_list *orig_kills = this->kills;
> >     bool orig_killed_all = this->killed_all;
> >  
> > -   hash_table *orig_lhs_ht = lhs_ht;
> > -   hash_table *orig_rhs_ht = rhs_ht;
> > -
> >     this->kills = new(mem_ctx) exec_list;
> >     this->killed_all = false;
> >  
> > -   create_acp();
> > +   copy_propagation_state *orig_state = state;
> > +   this->state = new(mem_ctx) copy_propagation_state(mem_ctx, lin_ctx);
> >  
> >     visit_list_elements(this, &ir->body);
> >  
> > -   ralloc_free(this->kills);
> > -
> > -   destroy_acp();
> > +   delete this->state;
> > +   this->state = orig_state;
> 
> Don't you want destroy_acp()'s body in ~copy_propagation_state()?

We allocate the tables themselves using the state as a context, so we
don't need to explicitly destroy them. Added a comment about this.


Thanks,
Caio


More information about the mesa-dev mailing list