i965/nir: Do not scalarize phis in non-scalar setups
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 15 Jul 2015 07:32:17 +0000 (09:32 +0200)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 3 Aug 2015 16:40:51 +0000 (09:40 -0700)
Significantly reduces register pressure in some piglit tests.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/dri/i965/brw_nir.c

index 49d174225464e1e164a123a76f2386a4b9d2b6cb..b5788fa2e33b0ee0192474cff2454f8d1df7330b 100644 (file)
@@ -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);