i965/gs: Add a case to brwNewProgram() for geometry shaders.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_fs_copy_propagation.cpp
index 5ea8ea574ff6fbcbbbb3113caf917a5b3b3827d5..2780ab6fd6d6663f0770a338a725377edd683ab0 100644 (file)
@@ -83,6 +83,8 @@ public:
    void setup_initial_values();
    void run();
 
+   void dump_block_data() const;
+
    void *mem_ctx;
    cfg_t *cfg;
 
@@ -243,6 +245,34 @@ fs_copy_prop_dataflow::run()
    } while (progress);
 }
 
+void
+fs_copy_prop_dataflow::dump_block_data() const
+{
+   for (int b = 0; b < cfg->num_blocks; b++) {
+      bblock_t *block = cfg->blocks[b];
+      printf("Block %d [%d, %d] (parents ", block->block_num,
+             block->start_ip, block->end_ip);
+      foreach_list(block_node, &block->parents) {
+         bblock_t *parent = ((bblock_link *) block_node)->block;
+         printf("%d ", parent->block_num);
+      }
+      printf("):\n");
+      printf("       livein = 0x");
+      for (int i = 0; i < bitset_words; i++)
+         printf("%08x", bd[b].livein[i]);
+      printf(", liveout = 0x");
+      for (int i = 0; i < bitset_words; i++)
+         printf("%08x", bd[b].liveout[i]);
+      printf(",\n       copy   = 0x");
+      for (int i = 0; i < bitset_words; i++)
+         printf("%08x", bd[b].copy[i]);
+      printf(", kill    = 0x");
+      for (int i = 0; i < bitset_words; i++)
+         printf("%08x", bd[b].kill[i]);
+      printf("\n");
+   }
+}
+
 bool
 fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry)
 {
@@ -494,7 +524,6 @@ fs_visitor::opt_copy_propagate()
                                           out_acp[b]) || progress;
    }
 
-   #if 0
    /* Do dataflow analysis for those available copies. */
    fs_copy_prop_dataflow dataflow(mem_ctx, &cfg, out_acp);
 
@@ -514,7 +543,6 @@ fs_visitor::opt_copy_propagate()
 
       progress = opt_copy_propagate_local(mem_ctx, block, in_acp) || progress;
    }
-   #endif
 
    for (int i = 0; i < cfg.num_blocks; i++)
       delete [] out_acp[i];