i965/nir: Run DCE again before going out of SSA
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 1 Apr 2015 19:37:43 +0000 (12:37 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 1 Apr 2015 19:51:04 +0000 (12:51 -0700)
We run lowering and optimization passes that might leave garbage lying
around. This keeps the FS cse from having to clean it up.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index 94641cf2ec1e00ec21e02013ae7fbfdb2b244e86..4dfb4d693aeb68a5615aa3f5352f31d8aa338917 100644 (file)
@@ -163,6 +163,8 @@ fs_visitor::emit_nir_code()
    nir_validate_shader(nir);
    nir_copy_prop(nir);
    nir_validate_shader(nir);
+   nir_opt_dce(nir);
+   nir_validate_shader(nir);
 
    if (unlikely(debug_enabled)) {
       fprintf(stderr, "NIR (SSA form) for %s shader:\n", stage_name);