[Mesa-dev] [PATCH 07/11] i965: Make the cfg reusable from the VS.

Eric Anholt eric at anholt.net
Thu Oct 4 16:07:44 PDT 2012


---
 src/mesa/drivers/dri/i965/brw_cfg.cpp              |   20 ++++++++++----------
 src/mesa/drivers/dri/i965/brw_cfg.h                |    6 +++---
 .../drivers/dri/i965/brw_fs_copy_propagation.cpp   |    2 +-
 src/mesa/drivers/dri/i965/brw_fs_cse.cpp           |    2 +-
 .../drivers/dri/i965/brw_fs_live_variables.cpp     |    2 +-
 5 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_cfg.cpp b/src/mesa/drivers/dri/i965/brw_cfg.cpp
index 8382764..79aafb2 100644
--- a/src/mesa/drivers/dri/i965/brw_cfg.cpp
+++ b/src/mesa/drivers/dri/i965/brw_cfg.cpp
@@ -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);
diff --git a/src/mesa/drivers/dri/i965/brw_cfg.h b/src/mesa/drivers/dri/i965/brw_cfg.h
index 4b015e3..3b031df 100644
--- a/src/mesa/drivers/dri/i965/brw_cfg.h
+++ b/src/mesa/drivers/dri/i965/brw_cfg.h
@@ -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);
diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
index 64e28c3..9310aef 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -82,7 +82,7 @@ fs_visitor::opt_copy_propagate_local(void *mem_ctx,
 {
    bool progress = false;
 
-   for (fs_inst *inst = block->start;
+   for (fs_inst *inst = (fs_inst *)block->start;
 	inst != block->end->next;
 	inst = (fs_inst *)inst->next) {
 
diff --git a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
index 4958433..70c143a 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
@@ -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) {
 
diff --git a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
index b006514..d7bb721 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
@@ -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) {
 
-- 
1.7.10.4



More information about the mesa-dev mailing list