[Mesa-dev] [PATCH 5/5] glsl: Improve the local dead code optimization to eliminate unused channels.

Eric Anholt eric at anholt.net
Wed May 9 18:41:46 PDT 2012


On Wed, 09 May 2012 08:46:30 -0700, Ian Romanick <idr at freedesktop.org> wrote:
> On 05/08/2012 05:59 PM, Eric Anholt wrote:
> > Total instructions: 261582 ->  261316
> > 135/2147 programs affected (6.3%)
> > 36752 ->  36486 instructions in affected programs (0.7% reduction)
> >
> > This excludes a tropics shader that now gets 16-wide mode and throws
> > off the numbers.  5 shaders are hurt: two extra MOVs in 4 tropics
> > shaders it looks like because we don't split register names according
> > to independent webs, and one gstreamer shader where it looks like
> > try_rewrite_rhs_to_dst() is falling on its face.
> >
> > This should also help avoid a regression in VSes from idr's ARB
> > programs to GLSL work.
> 
> Sort of, but not really.  It seems to change cases like

[...]

Yeah, we seriously need to do coalescing in the VS.

One thing related to this failure that I'd thought about was doing
pushing of swizzles down expression trees at the IR level: (mul a, b).y
-> (mul a.y, b.y).  It would tell this dead code elimination a lot more
about what was dead, and it should avoid the failure you highlighted for
some expressions.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120509/6fdcc973/attachment.pgp>


More information about the mesa-dev mailing list