i965/nir: Make use of nir_opt_undef
authorBoyan Ding <boyan.j.ding@gmail.com>
Fri, 21 Aug 2015 13:42:45 +0000 (21:42 +0800)
committerMatt Turner <mattst88@gmail.com>
Fri, 28 Aug 2015 06:33:49 +0000 (23:33 -0700)
Shader-db result on Ivy Bridge:
total instructions in shared programs: 145484 -> 145445 (-0.03%)
instructions in affected programs:     225 -> 186 (-17.33%)
helped:                                5
HURT:                                  0

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
src/mesa/drivers/dri/i965/brw_nir.c

index 8c6d28a7cd88931d31c902a0694dbe86611a954c..247b223f2e2cb42adcd078f3eca176b071753808 100644 (file)
@@ -63,6 +63,8 @@ nir_optimize(nir_shader *nir, bool is_scalar)
       nir_validate_shader(nir);
       progress |= nir_opt_remove_phis(nir);
       nir_validate_shader(nir);
+      progress |= nir_opt_undef(nir);
+      nir_validate_shader(nir);
    } while (progress);
 }