v3d: Add an optimization pass for redundant flags updates

Graphics / Mesa 3D Graphics Library / Mesa - Eric Anholt [anholt.net] - 11 April 2019 16:24 EDT

Our exec masking introduces lots of redundant flags updates, and even without that there will be cases where NIR comparisons on the same sources for different reasons may generate the same comparison instruction before the selection.

total instructions in shared programs: 6492930 -> 6460934 (-0.49%) total uniforms in shared programs: 2117460 -> 2115106 (-0.11%) total spills in shared programs: 4983 -> 4987 (0.08%) total fills in shared programs: 6408 -> 6416 (0.12%)

8f065596d22 v3d: Add an optimization pass for redundant flags updates.
src/broadcom/Makefile.sources | 1 +
src/broadcom/compiler/meson.build | 1 +
src/broadcom/compiler/v3d_compiler.h | 1 +
src/broadcom/compiler/vir.c | 1 +
src/broadcom/compiler/vir_opt_redundant_flags.c | 139 ++++++++++++++++++++++++
5 files changed, 143 insertions(+)

Upstream: cgit.freedesktop.org


  • Share