[Mesa-dev] [PATCH 1/6] i965: Only consider fixed_hw_reg in equals() if file is HW_REG/IMM.

Jason Ekstrand jason at jlekstrand.net
Thu Aug 27 22:37:53 PDT 2015


On Aug 27, 2015 10:33 PM, "Kenneth Graunke" <kenneth at whitecape.org> wrote:
>
> On Thursday, August 27, 2015 10:17:24 PM Matt Turner wrote:
> > Noticed when debugging things that lead to the next patch.
> >
> > On G45 (and presumably ILK) this helps register coalescing:
> >
> > total instructions in shared programs: 4077373 -> 4077340 (-0.00%)
> > instructions in affected programs:     43751 -> 43718 (-0.08%)
> > helped:                                52
> > HURT:                                  2
> > ---
> >  src/mesa/drivers/dri/i965/brw_fs.cpp   | 4 +++-
> >  src/mesa/drivers/dri/i965/brw_vec4.cpp | 5 +++--
> >  2 files changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp
b/src/mesa/drivers/dri/i965/brw_fs.cpp
> > index 81009a0..269914d 100644
> > --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> > +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> > @@ -427,7 +427,9 @@ fs_reg::equals(const fs_reg &r) const
> >             negate == r.negate &&
> >             abs == r.abs &&
> >             !reladdr && !r.reladdr &&
> > -           memcmp(&fixed_hw_reg, &r.fixed_hw_reg,
sizeof(fixed_hw_reg)) == 0 &&
> > +           ((file != HW_REG && file != IMM) ||
> > +            memcmp(&fixed_hw_reg, &r.fixed_hw_reg,
> > +                   sizeof(fixed_hw_reg)) == 0) &&
> >             stride == r.stride);
> >  }
> >
> > diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp
b/src/mesa/drivers/dri/i965/brw_vec4.cpp
> > index f18915a..b97b6c1 100644
> > --- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
> > +++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
> > @@ -216,8 +216,9 @@ dst_reg::equals(const dst_reg &r) const
> >             writemask == r.writemask &&
> >             (reladdr == r.reladdr ||
> >              (reladdr && r.reladdr && reladdr->equals(*r.reladdr))) &&
> > -           memcmp(&fixed_hw_reg, &r.fixed_hw_reg,
> > -                  sizeof(fixed_hw_reg)) == 0);
> > +           ((file != HW_REG && file != IMM) ||
> > +            memcmp(&fixed_hw_reg, &r.fixed_hw_reg,
> > +                   sizeof(fixed_hw_reg)) == 0));
> >  }
> >
> >  bool
> >
>
> Nice!  The updated live range handling makes a lot more sense - I always
> thought the old stuff was bunk...nice to see it was just papering over
bugs.
>
> Series is:
> Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

Bah! Beat me to it...

Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>

> Also, thank you for producing a series that, despite touching a complex
> piece of code, I was able to review completely in 15 minutes!
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150827/27208f80/attachment.html>


More information about the mesa-dev mailing list