[Mesa-dev] [PATCH 1/4] i965/fs: Do dead code elimination just after copy propagation.

Eric Anholt eric at anholt.net
Tue Oct 30 20:28:52 PDT 2012


If we put the register coalescing in between the two, then we end up with code
sequences involving dead writes that the dead code elimination doesn't know
how to remove.  In place of making dead code elimination smart (which we
should do, too), make it less important for the moment.

shader-db results:

total instructions in shared programs: 722240 -> 721275 (-0.13%)
instructions in affected programs:     50573 -> 49608 (-1.91%)

(no shaders regressed).
---
 src/mesa/drivers/dri/i965/brw_fs.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 56cb447..6605640 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1865,10 +1865,10 @@ fs_visitor::run()
 	 progress = opt_algebraic() || progress;
 	 progress = opt_cse() || progress;
 	 progress = opt_copy_propagate() || progress;
+	 progress = dead_code_eliminate() || progress;
 	 progress = register_coalesce() || progress;
 	 progress = register_coalesce_2() || progress;
 	 progress = compute_to_mrf() || progress;
-	 progress = dead_code_eliminate() || progress;
       } while (progress);
 
       remove_dead_constants();
-- 
1.7.10.4



More information about the mesa-dev mailing list