i965: Make the cfg reusable from the VS.
authorEric Anholt <eric@anholt.net>
Wed, 3 Oct 2012 20:17:58 +0000 (13:17 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 17 Oct 2012 19:24:00 +0000 (12:24 -0700)
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_copy_propagation.cpp
src/mesa/drivers/dri/i965/brw_fs_cse.cpp
src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp

index 8382764ce34a334cf199c49dc0b483d21d212c52..79aafb23826d4d8c96e8d959ac5edc3bbd6a3d6e 100644 (file)
@@ -66,7 +66,7 @@ bblock_t::make_list(void *mem_ctx)
    return new(mem_ctx) bblock_link(this);
 }
 
-cfg_t::cfg_t(fs_visitor *v)
+cfg_t::cfg_t(backend_visitor *v)
 {
    mem_ctx = ralloc_context(v->mem_ctx);
    block_list.make_empty();
@@ -82,10 +82,10 @@ cfg_t::cfg_t(fs_visitor *v)
 
    set_next_block(entry);
 
-   entry->start = (fs_inst *)v->instructions.get_head();
+   entry->start = (backend_instruction *)v->instructions.get_head();
 
    foreach_list(node, &v->instructions) {
-      fs_inst *inst = (fs_inst *)node;
+      backend_instruction *inst = (backend_instruction *)node;
 
       cur->end = inst;
 
@@ -112,7 +112,7 @@ cfg_t::cfg_t(fs_visitor *v)
          * instructions.
          */
         next = new_block();
-        next->start = (fs_inst *)inst->next;
+        next->start = (backend_instruction *)inst->next;
         cur_if->add_successor(mem_ctx, next);
 
         set_next_block(next);
@@ -122,7 +122,7 @@ cfg_t::cfg_t(fs_visitor *v)
         cur->add_successor(mem_ctx, cur_endif);
 
         next = new_block();
-        next->start = (fs_inst *)inst->next;
+        next->start = (backend_instruction *)inst->next;
         cur_if->add_successor(mem_ctx, next);
         cur_else = next;
 
@@ -130,7 +130,7 @@ cfg_t::cfg_t(fs_visitor *v)
         break;
 
       case BRW_OPCODE_ENDIF:
-        cur_endif->start = (fs_inst *)inst->next;
+        cur_endif->start = (backend_instruction *)inst->next;
         cur->add_successor(mem_ctx, cur_endif);
         set_next_block(cur_endif);
 
@@ -159,7 +159,7 @@ cfg_t::cfg_t(fs_visitor *v)
          * instructions.
          */
         next = new_block();
-        next->start = (fs_inst *)inst->next;
+        next->start = (backend_instruction *)inst->next;
         cur->add_successor(mem_ctx, next);
         cur_do = next;
 
@@ -170,7 +170,7 @@ cfg_t::cfg_t(fs_visitor *v)
         cur->add_successor(mem_ctx, cur_do);
 
         next = new_block();
-        next->start = (fs_inst *)inst->next;
+        next->start = (backend_instruction *)inst->next;
         if (inst->predicate)
            cur->add_successor(mem_ctx, next);
 
@@ -181,7 +181,7 @@ cfg_t::cfg_t(fs_visitor *v)
         cur->add_successor(mem_ctx, cur_while);
 
         next = new_block();
-        next->start = (fs_inst *)inst->next;
+        next->start = (backend_instruction *)inst->next;
         if (inst->predicate)
            cur->add_successor(mem_ctx, next);
 
@@ -189,7 +189,7 @@ cfg_t::cfg_t(fs_visitor *v)
         break;
 
       case BRW_OPCODE_WHILE:
-        cur_while->start = (fs_inst *)inst->next;
+        cur_while->start = (backend_instruction *)inst->next;
 
         cur->add_successor(mem_ctx, cur_do);
         set_next_block(cur_while);
index 4b015e3465411c232f0706ad7b6b9e62ef7c9a41..3b031df938b8dd7e05a207b288ef9c8b81b82cd4 100644 (file)
@@ -55,8 +55,8 @@ public:
 
    void add_successor(void *mem_ctx, bblock_t *successor);
 
-   fs_inst *start;
-   fs_inst *end;
+   backend_instruction *start;
+   backend_instruction *end;
 
    int start_ip;
    int end_ip;
@@ -78,7 +78,7 @@ public:
       return node;
    }
 
-   cfg_t(fs_visitor *v);
+   cfg_t(backend_visitor *v);
    ~cfg_t();
    bblock_t *new_block();
    void set_next_block(bblock_t *block);
index 1275e697097b7673ff8c38272f2fba2b02e5f2cb..2fff68883356d40c4b6074561e690ab9baa78b0e 100644 (file)
@@ -201,7 +201,7 @@ fs_visitor::opt_copy_propagate_local(void *mem_ctx, bblock_t *block)
    int acp_count = 16;
    exec_list acp[acp_count];
 
-   for (fs_inst *inst = block->start;
+   for (fs_inst *inst = (fs_inst *)block->start;
        inst != block->end->next;
        inst = (fs_inst *)inst->next) {
 
index 49584334c0c5f75b648a7f7bd16f2cc0fc677072..70c143af90e21e78d5243af3fc0c230ec78ee407 100644 (file)
@@ -87,7 +87,7 @@ fs_visitor::opt_cse_local(bblock_t *block, exec_list *aeb)
 
    void *mem_ctx = ralloc_context(this->mem_ctx);
 
-   for (fs_inst *inst = block->start;
+   for (fs_inst *inst = (fs_inst *)block->start;
        inst != block->end->next;
        inst = (fs_inst *) inst->next) {
 
index b0065145d1dd070203330e855f74e5fce49682ac..d7bb72136768ad61bcd7ac8d0da00b56476b68dd 100644 (file)
@@ -58,7 +58,7 @@ fs_live_variables::setup_def_use()
       if (b > 0)
         assert(cfg->blocks[b - 1]->end_ip == ip - 1);
 
-      for (fs_inst *inst = block->start;
+      for (fs_inst *inst = (fs_inst *)block->start;
           inst != block->end->next;
           inst = (fs_inst *)inst->next) {