i965/fs: Skip the initial block when updating livein/liveout.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 10 Aug 2013 01:47:19 +0000 (18:47 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 19 Aug 2013 18:29:24 +0000 (11:29 -0700)
The starting block always has livein = 0 and liveout = copy.  Since we
start with real data, not estimates, there's no need to refine it with
the fixed point algorithm.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp

index b5d698037ce1dcb1d83daece2aa1148e3e93a871..7662f6a3656f6f2ab1f212214ffd1f0a09d6d2ff 100644 (file)
@@ -205,6 +205,9 @@ fs_copy_prop_dataflow::run()
 
       /* Update liveout for all blocks. */
       for (int b = 0; b < cfg->num_blocks; b++) {
+         if (cfg->blocks[b]->parents.is_empty())
+            continue;
+
          for (int i = 0; i < bitset_words; i++) {
             const BITSET_WORD old_liveout = bd[b].liveout[i];
 
@@ -220,6 +223,9 @@ fs_copy_prop_dataflow::run()
        * blocks, it's live coming in to this block.
        */
       for (int b = 0; b < cfg->num_blocks; b++) {
+         if (cfg->blocks[b]->parents.is_empty())
+            continue;
+
          for (int i = 0; i < bitset_words; i++) {
             BITSET_WORD new_livein = ~bd[b].livein[i];
             foreach_list(block_node, &cfg->blocks[b]->parents) {