[Mesa-dev] [PATCH v2 78/78] i965/nir: Do not scalarize phis in non-scalar setups

Eduardo Lima Mitev elima at igalia.com
Thu Jul 23 03:17:58 PDT 2015


From: Iago Toral Quiroga <itoral at igalia.com>

Significantly reduces register pressure in some piglit tests.
---
 src/mesa/drivers/dri/i965/brw_nir.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
index a4ea147..87b7a30 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -42,8 +42,12 @@ nir_optimize(nir_shader *nir, bool is_scalar)
 
       progress |= nir_copy_prop(nir);
       nir_validate_shader(nir);
-      nir_lower_phis_to_scalar(nir);
-      nir_validate_shader(nir);
+
+      if (is_scalar) {
+         nir_lower_phis_to_scalar(nir);
+         nir_validate_shader(nir);
+      }
+
       progress |= nir_copy_prop(nir);
       nir_validate_shader(nir);
       progress |= nir_opt_dce(nir);
-- 
2.1.4



More information about the mesa-dev mailing list