vc4: Enforce one-uniform-per-instruction after optimization.
authorEric Anholt <eric@anholt.net>
Thu, 19 Feb 2015 20:58:53 +0000 (12:58 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 20 Feb 2015 07:35:17 +0000 (23:35 -0800)
commit14dc281c1332518b6144718e1fb3845abbe23ff7
tree7726018b2b9106c2d184236027fb56b3dcdd68be
parent09c844fcd9c0dc81da4f914e6b88892ea76fe8e9
vc4: Enforce one-uniform-per-instruction after optimization.

This lets us more intelligently decide which uniform values should be put
into temporaries, by choosing the most reused values to push to temps
first.

total uniforms in shared programs: 13457 -> 13433 (-0.18%)
uniforms in affected programs:     1524 -> 1500 (-1.57%)
total instructions in shared programs: 40198 -> 40019 (-0.45%)
instructions in affected programs:     6027 -> 5848 (-2.97%)

I noticed this opportunity because with the NIR work, some programs were
happening to make different uniform copy propagation choices that
significantly increased instruction counts.
src/gallium/drivers/vc4/Makefile.sources
src/gallium/drivers/vc4/vc4_opt_copy_propagation.c
src/gallium/drivers/vc4/vc4_program.c
src/gallium/drivers/vc4/vc4_qir.c
src/gallium/drivers/vc4/vc4_qir.h
src/gallium/drivers/vc4/vc4_qir_lower_uniforms.c [new file with mode: 0644]