On Mon, Apr 4, 2016 at 10:23 AM, Kenneth Graunke <kenn...@whitecape.org>
wrote:

> On Monday, April 4, 2016 12:19:57 AM PDT Jason Ekstrand wrote:
> > On Sun, Apr 3, 2016 at 10:56 PM, Kenneth Graunke <kenn...@whitecape.org>
> > wrote:
> >
> > > There may not be a previous block.  In this case, there's no real work
> > > to do, so just continue on to the next one.
> > >
> > > v2: Update for bblock->prev() API change.
> > >
> > > Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
> > > ---
> > >  src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp
> > > b/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp
> > > index 2c1abaf..114dc6c 100644
> > > --- a/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp
> > > +++ b/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp
> > > @@ -42,6 +42,10 @@ dead_control_flow_eliminate(backend_shader *s)
> > >
> > >     foreach_block_safe (block, s->cfg) {
> > >        bblock_t *prev_block = block->prev();
> > > +
> > > +      if (!prev_block)
> > > +         continue;
> > > +
> > >        backend_instruction *const inst = block->start();
> > >        backend_instruction *const prev_inst = prev_block->end();
> > >
> >
> > Yeah, that guy right there will be a problem on the first loop iteration
> > every time.  I've seen this in valgrind quite a bit lately.  Thanks for
> > fixing it!
> >
> > Reviewed-by: Jason Ekstrand <ja...@jlekstrand.net>
> >
> > Maybe Cc stable?
> > --Jason
>
> I checked 10.2 on the first spin of this series, and I didn't see the
> valgrind errors there.
>

Sounds good
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to