i965: Rename fs_cfg types to not mention fs.
authorEric Anholt <eric@anholt.net>
Wed, 3 Oct 2012 20:16:09 +0000 (13:16 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 17 Oct 2012 19:24:00 +0000 (12:24 -0700)
fs_bblock_link -> bblock_link
fs_bblock -> bblock_t (to avoid conflicting with all the fs_bblock *bblock)
fs_cfg -> cfg_t (to avoid conflicting with all the fs_cfg *cfg)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_cfg.cpp
src/mesa/drivers/dri/i965/brw_cfg.h
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
src/mesa/drivers/dri/i965/brw_fs_cse.cpp
src/mesa/drivers/dri/i965/brw_fs_emit.cpp
src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
src/mesa/drivers/dri/i965/brw_fs_live_variables.h

index 575444678f13fd5487f9c72c8fe9b46c0af9531a..539cb084d4e2464230634e576c2e9d6c1f603fc6 100644 (file)
 #include "brw_fs.h"
 #include "brw_cfg.h"
 
-/** @file brw_fs_cfg.cpp
+/** @file brw_cfg_t.cpp
  *
  * Walks the shader instructions generated and creates a set of basic
  * blocks with successor/predecessor edges connecting them.
  */
 
-static fs_bblock *
+static bblock_t *
 pop_stack(exec_list *list)
 {
-   fs_bblock_link *link = (fs_bblock_link *)list->get_tail();
-   fs_bblock *block = link->block;
+   bblock_link *link = (bblock_link *)list->get_tail();
+   bblock_t *block = link->block;
    link->remove();
 
    return block;
 }
 
-fs_bblock::fs_bblock()
+bblock_t::bblock_t()
 {
    start = NULL;
    end = NULL;
@@ -54,19 +54,19 @@ fs_bblock::fs_bblock()
 }
 
 void
-fs_bblock::add_successor(void *mem_ctx, fs_bblock *successor)
+bblock_t::add_successor(void *mem_ctx, bblock_t *successor)
 {
    successor->parents.push_tail(this->make_list(mem_ctx));
    children.push_tail(successor->make_list(mem_ctx));
 }
 
-fs_bblock_link *
-fs_bblock::make_list(void *mem_ctx)
+bblock_link *
+bblock_t::make_list(void *mem_ctx)
 {
-   return new(mem_ctx) fs_bblock_link(this);
+   return new(mem_ctx) bblock_link(this);
 }
 
-fs_cfg::fs_cfg(fs_visitor *v)
+cfg_t::cfg_t(fs_visitor *v)
 {
    mem_ctx = ralloc_context(v->mem_ctx);
    block_list.make_empty();
@@ -74,11 +74,11 @@ fs_cfg::fs_cfg(fs_visitor *v)
    ip = 0;
    cur = NULL;
 
-   fs_bblock *entry = new_block();
-   fs_bblock *cur_if = NULL, *cur_else = NULL, *cur_endif = NULL;
-   fs_bblock *cur_do = NULL, *cur_while = NULL;
+   bblock_t *entry = new_block();
+   bblock_t *cur_if = NULL, *cur_else = NULL, *cur_endif = NULL;
+   bblock_t *cur_do = NULL, *cur_while = NULL;
    exec_list if_stack, else_stack, endif_stack, do_stack, while_stack;
-   fs_bblock *next;
+   bblock_t *next;
 
    set_next_block(entry);
 
@@ -209,21 +209,21 @@ fs_cfg::fs_cfg(fs_visitor *v)
    make_block_array();
 }
 
-fs_cfg::~fs_cfg()
+cfg_t::~cfg_t()
 {
    ralloc_free(mem_ctx);
 }
 
-fs_bblock *
-fs_cfg::new_block()
+bblock_t *
+cfg_t::new_block()
 {
-   fs_bblock *block = new(mem_ctx) fs_bblock();
+   bblock_t *block = new(mem_ctx) bblock_t();
 
    return block;
 }
 
 void
-fs_cfg::set_next_block(fs_bblock *block)
+cfg_t::set_next_block(bblock_t *block)
 {
    if (cur) {
       assert(cur->end->next == block->start);
@@ -237,13 +237,13 @@ fs_cfg::set_next_block(fs_bblock *block)
 }
 
 void
-fs_cfg::make_block_array()
+cfg_t::make_block_array()
 {
-   blocks = ralloc_array(mem_ctx, fs_bblock *, num_blocks);
+   blocks = ralloc_array(mem_ctx, bblock_t *, num_blocks);
 
    int i = 0;
    foreach_list(block_node, &block_list) {
-      fs_bblock_link *link = (fs_bblock_link *)block_node;
+      bblock_link *link = (bblock_link *)block_node;
       blocks[i++] = link->block;
    }
    assert(i == num_blocks);
index 0038f929737b5100e61906024dad5d9c8b498b4d..4b015e3465411c232f0706ad7b6b9e62ef7c9a41 100644 (file)
 
 #include "brw_fs.h"
 
-class fs_bblock_link : public exec_node {
+class bblock_link : public exec_node {
 public:
-   fs_bblock_link(fs_bblock *block)
+   bblock_link(bblock_t *block)
       : block(block)
    {
    }
 
-   fs_bblock *block;
+   bblock_t *block;
 };
 
-class fs_bblock {
+class bblock_t {
 public:
    static void* operator new(size_t size, void *ctx)
    {
@@ -49,11 +49,11 @@ public:
       return node;
    }
 
-   fs_bblock_link *make_list(void *mem_ctx);
+   bblock_link *make_list(void *mem_ctx);
 
-   fs_bblock();
+   bblock_t();
 
-   void add_successor(void *mem_ctx, fs_bblock *successor);
+   void add_successor(void *mem_ctx, bblock_t *successor);
 
    fs_inst *start;
    fs_inst *end;
@@ -66,7 +66,7 @@ public:
    int block_num;
 };
 
-class fs_cfg {
+class cfg_t {
 public:
    static void* operator new(size_t size, void *ctx)
    {
@@ -78,17 +78,17 @@ public:
       return node;
    }
 
-   fs_cfg(fs_visitor *v);
-   ~fs_cfg();
-   fs_bblock *new_block();
-   void set_next_block(fs_bblock *block);
+   cfg_t(fs_visitor *v);
+   ~cfg_t();
+   bblock_t *new_block();
+   void set_next_block(bblock_t *block);
    void make_block_array();
 
    /** @{
     *
     * Used while generating the block list.
     */
-   fs_bblock *cur;
+   bblock_t *cur;
    int ip;
    /** @} */
 
@@ -96,6 +96,6 @@ public:
 
    /** Ordered list (by ip) of basic blocks */
    exec_list block_list;
-   fs_bblock **blocks;
+   bblock_t **blocks;
    int num_blocks;
 };
index bfbcad676d2fe6a21ea535f83443fe7f679c332a..87cbbe22538070878fc5a98e4a515200fdb9393d 100644 (file)
@@ -50,7 +50,7 @@ extern "C" {
 #include "glsl/glsl_types.h"
 #include "glsl/ir.h"
 
-class fs_bblock;
+class bblock_t;
 namespace {
    class acp_entry;
 }
@@ -242,11 +242,11 @@ public:
    void calculate_live_intervals();
    bool opt_algebraic();
    bool opt_cse();
-   bool opt_cse_local(fs_bblock *block, exec_list *aeb);
+   bool opt_cse_local(bblock_t *block, exec_list *aeb);
    bool opt_copy_propagate();
    bool try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry);
    bool try_constant_propagate(fs_inst *inst, acp_entry *entry);
-   bool opt_copy_propagate_local(void *mem_ctx, fs_bblock *block);
+   bool opt_copy_propagate_local(void *mem_ctx, bblock_t *block);
    bool register_coalesce();
    bool register_coalesce_2();
    bool compute_to_mrf();
@@ -422,7 +422,7 @@ public:
    int force_uncompressed_stack;
    int force_sechalf_stack;
 
-   class fs_bblock *bblock;
+   class bblock_t *bblock;
 };
 
 bool brw_do_channel_expressions(struct exec_list *instructions);
index f51f7b944e7c5aa73c3e348288797d71080e8d2c..7ab1c5113aa6294850d6a0ba35596551daa7ff33 100644 (file)
@@ -195,7 +195,7 @@ fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry)
  * list.
  */
 bool
-fs_visitor::opt_copy_propagate_local(void *mem_ctx, fs_bblock *block)
+fs_visitor::opt_copy_propagate_local(void *mem_ctx, bblock_t *block)
 {
    bool progress = false;
    int acp_count = 16;
@@ -273,10 +273,10 @@ fs_visitor::opt_copy_propagate()
    bool progress = false;
    void *mem_ctx = ralloc_context(this->mem_ctx);
 
-   fs_cfg cfg(this);
+   cfg_t cfg(this);
 
    for (int b = 0; b < cfg.num_blocks; b++) {
-      fs_bblock *block = cfg.blocks[b];
+      bblock_t *block = cfg.blocks[b];
 
       progress = opt_copy_propagate_local(mem_ctx, block) || progress;
    }
index bb3ba66350d5dd74f0f368f7f2d0487928b2003b..a231868c0b9855b304e926f568d1693c71294b5d 100644 (file)
@@ -81,7 +81,7 @@ operands_match(fs_reg *xs, fs_reg *ys)
 }
 
 bool
-fs_visitor::opt_cse_local(fs_bblock *block, exec_list *aeb)
+fs_visitor::opt_cse_local(bblock_t *block, exec_list *aeb)
 {
    bool progress = false;
 
@@ -176,10 +176,10 @@ fs_visitor::opt_cse()
 {
    bool progress = false;
 
-   fs_cfg cfg(this);
+   cfg_t cfg(this);
 
    for (int b = 0; b < cfg.num_blocks; b++) {
-      fs_bblock *block = cfg.blocks[b];
+      bblock_t *block = cfg.blocks[b];
       exec_list aeb;
 
       progress = opt_cse_local(block, &aeb) || progress;
index ec39c0a69ece67b4eed9d510e7be2221853c11e6..55c36ca69a763b79e1b460b8a1fb89c36aa3d7cd 100644 (file)
@@ -738,9 +738,9 @@ fs_visitor::generate_code()
       }
    }
 
-   fs_cfg *cfg = NULL;
+   cfg_t *cfg = NULL;
    if (unlikely(INTEL_DEBUG & DEBUG_WM))
-      cfg = new(mem_ctx) fs_cfg(this);
+      cfg = new(mem_ctx) cfg_t(this);
 
    foreach_list(node, &this->instructions) {
       fs_inst *inst = (fs_inst *)node;
@@ -748,15 +748,15 @@ fs_visitor::generate_code()
 
       if (unlikely(INTEL_DEBUG & DEBUG_WM)) {
         foreach_list(node, &cfg->block_list) {
-           fs_bblock_link *link = (fs_bblock_link *)node;
-           fs_bblock *block = link->block;
+           bblock_link *link = (bblock_link *)node;
+           bblock_t *block = link->block;
 
            if (block->start == inst) {
               printf("   START B%d", block->block_num);
               foreach_list(predecessor_node, &block->parents) {
-                 fs_bblock_link *predecessor_link =
-                    (fs_bblock_link *)predecessor_node;
-                 fs_bblock *predecessor_block = predecessor_link->block;
+                 bblock_link *predecessor_link =
+                    (bblock_link *)predecessor_node;
+                 bblock_t *predecessor_block = predecessor_link->block;
                  printf(" <-B%d", predecessor_block->block_num);
               }
               printf("\n");
@@ -1020,15 +1020,15 @@ fs_visitor::generate_code()
                          last_native_insn_offset, p->next_insn_offset);
 
         foreach_list(node, &cfg->block_list) {
-           fs_bblock_link *link = (fs_bblock_link *)node;
-           fs_bblock *block = link->block;
+           bblock_link *link = (bblock_link *)node;
+           bblock_t *block = link->block;
 
            if (block->end == inst) {
               printf("   END B%d", block->block_num);
               foreach_list(successor_node, &block->children) {
-                 fs_bblock_link *successor_link =
-                    (fs_bblock_link *)successor_node;
-                 fs_bblock *successor_block = successor_link->block;
+                 bblock_link *successor_link =
+                    (bblock_link *)successor_node;
+                 bblock_t *successor_block = successor_link->block;
                  printf(" ->B%d", successor_block->block_num);
               }
               printf("\n");
index 667f1e85a59e9c49fd281315c9364da839f36eb7..f41d6332dd094c22707773c4b3134721c3cc2cef 100644 (file)
@@ -52,7 +52,7 @@ fs_live_variables::setup_def_use()
    int ip = 0;
 
    for (int b = 0; b < cfg->num_blocks; b++) {
-      fs_bblock *block = cfg->blocks[b];
+      bblock_t *block = cfg->blocks[b];
 
       assert(ip == block->start_ip);
       if (b > 0)
@@ -118,8 +118,8 @@ fs_live_variables::compute_live_variables()
 
         /* Update liveout */
         foreach_list(block_node, &cfg->blocks[b]->children) {
-           fs_bblock_link *link = (fs_bblock_link *)block_node;
-           fs_bblock *block = link->block;
+           bblock_link *link = (bblock_link *)block_node;
+           bblock_t *block = link->block;
 
            for (int i = 0; i < num_vars; i++) {
               if (bd[block->block_num].livein[i] && !bd[b].liveout[i]) {
@@ -132,7 +132,7 @@ fs_live_variables::compute_live_variables()
    }
 }
 
-fs_live_variables::fs_live_variables(fs_visitor *v, fs_cfg *cfg)
+fs_live_variables::fs_live_variables(fs_visitor *v, cfg_t *cfg)
    : v(v), cfg(cfg)
 {
    mem_ctx = ralloc_context(cfg->mem_ctx);
@@ -203,7 +203,7 @@ fs_visitor::calculate_live_intervals()
    }
 
    /* Now, extend those intervals using our analysis of control flow. */
-   fs_cfg cfg(this);
+   cfg_t cfg(this);
    fs_live_variables livevars(this, &cfg);
 
    for (int b = 0; b < cfg.num_blocks; b++) {
index 065f31320604ce8cbd83690b4a329beb741496da..5f7e67e5138e555d6fbef486de370ac582882f9c 100644 (file)
@@ -62,14 +62,14 @@ public:
       return node;
    }
 
-   fs_live_variables(fs_visitor *v, fs_cfg *cfg);
+   fs_live_variables(fs_visitor *v, cfg_t *cfg);
    ~fs_live_variables();
 
    void setup_def_use();
    void compute_live_variables();
 
    fs_visitor *v;
-   fs_cfg *cfg;
+   cfg_t *cfg;
    void *mem_ctx;
 
    int num_vars;