[Mesa-dev] [RFC 2/2] i965/nir/vec4: Activate lower_vec_and_coalesce pass on non-scalar shaders

Eduardo Lima Mitev elima at igalia.com
Tue Sep 8 23:27:11 PDT 2015


Enable the lower_vec_and_coalesce pass on non-scalar shaders, after
the shader is out of SSA-form and before passing lower_vec_to_movs.

shader-db VS results against non-NIR before this patch:

total instructions in shared programs: 1853747 -> 1804428 (-2.66%)
instructions in affected programs:     1687580 -> 1638261 (-2.92%)
helped:                                6748
HURT:                                  11101
GAINED:                                0
LOST:                                  0

shader-db VS results against non-NIR after this patch:

total instructions in shared programs: 1853747 -> 1762126 (-4.94%)
instructions in affected programs:     1681255 -> 1589634 (-5.45%)
helped:                                7751
HURT:                                  9344
GAINED:                                0
LOST:                                  0
---
 src/mesa/drivers/dri/i965/brw_nir.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
index 8f3edc5..0797fda 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -187,6 +187,9 @@ brw_create_nir(struct brw_context *brw,
    nir_validate_shader(nir);
 
    if (!is_scalar) {
+      nir_lower_vec_and_coalesce(nir);
+      nir_validate_shader(nir);
+
       nir_lower_vec_to_movs(nir);
       nir_validate_shader(nir);
    }
-- 
2.4.6



More information about the mesa-dev mailing list