i965/fs: Do dead code elimination just after copy propagation.
authorEric Anholt <eric@anholt.net>
Tue, 30 Oct 2012 23:10:14 +0000 (16:10 -0700)
committerEric Anholt <eric@anholt.net>
Sun, 4 Nov 2012 19:15:44 +0000 (11:15 -0800)
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).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp

index 777879e1241cf9cc1f93f7a1a70e768cc42f540a..dc2e5a67725b27ae701bc21a0df152ef311bcc8b 100644 (file)
@@ -1925,10 +1925,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();