[Mesa-dev] [PATCH 2/2] nir: Optimize away IF statements with no body on either side.

Eric Anholt eric at anholt.net
Thu Jul 7 17:02:28 UTC 2016


Eric Anholt <eric at anholt.net> writes:

> Due to the rampant dead code elimination in coordinate shaders for vc4, we
> often end up with IFs that do nothing on either side.  In the
> loops-enabled build, shader-db gives:
>
> total instructions in shared programs: 125192 -> 119693 (-4.39%)
> instructions in affected programs:     30649 -> 25150 (-17.94%)
> total uniforms in shared programs: 38436 -> 37632 (-2.09%)
> uniforms in affected programs:     6168 -> 5364 (-13.04%)

This is totally broken because it doesn't consider the phi nodes after
the if, and I think the thing I was thinking of would be cleaned up by
peephole_select, anyway.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160707/7add0907/attachment.sig>


More information about the mesa-dev mailing list