[Mesa-dev] [PATCH 05/11] i965: Rename fs_cfg types to not mention fs.
Eric Anholt
eric at anholt.net
Thu Oct 4 16:07:42 PDT 2012
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)
---
src/mesa/drivers/dri/i965/brw_cfg.cpp | 44 ++++++++++----------
src/mesa/drivers/dri/i965/brw_cfg.h | 28 ++++++-------
src/mesa/drivers/dri/i965/brw_fs.h | 8 ++--
.../drivers/dri/i965/brw_fs_copy_propagation.cpp | 6 +--
src/mesa/drivers/dri/i965/brw_fs_cse.cpp | 6 +--
src/mesa/drivers/dri/i965/brw_fs_emit.cpp | 24 +++++------
.../drivers/dri/i965/brw_fs_live_variables.cpp | 10 ++---
src/mesa/drivers/dri/i965/brw_fs_live_variables.h | 4 +-
8 files changed, 65 insertions(+), 65 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_cfg.cpp b/src/mesa/drivers/dri/i965/brw_cfg.cpp
index 5754446..539cb08 100644
--- a/src/mesa/drivers/dri/i965/brw_cfg.cpp
+++ b/src/mesa/drivers/dri/i965/brw_cfg.cpp
@@ -28,23 +28,23 @@
#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);
diff --git a/src/mesa/drivers/dri/i965/brw_cfg.h b/src/mesa/drivers/dri/i965/brw_cfg.h
index 0038f92..4b015e3 100644
--- a/src/mesa/drivers/dri/i965/brw_cfg.h
+++ b/src/mesa/drivers/dri/i965/brw_cfg.h
@@ -27,17 +27,17 @@
#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;
};
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index 77e571b..311d88e 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -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;
}
@@ -247,10 +247,10 @@ public:
bool propagate_constants();
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 opt_copy_propagate_local(void *mem_ctx, fs_bblock *block,
+ bool opt_copy_propagate_local(void *mem_ctx, bblock_t *block,
exec_list *acp);
bool register_coalesce();
bool register_coalesce_2();
@@ -399,7 +399,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);
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 b19b957..f9606bf 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -78,7 +78,7 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry)
*/
bool
fs_visitor::opt_copy_propagate_local(void *mem_ctx,
- fs_bblock *block, exec_list *acp)
+ bblock_t *block, exec_list *acp)
{
bool progress = false;
@@ -137,10 +137,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];
exec_list acp;
progress = opt_copy_propagate_local(mem_ctx, block, &acp) || progress;
diff --git a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
index bb3ba66..a231868 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
@@ -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;
diff --git a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
index fbdfc3d..c354d53 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
@@ -733,9 +733,9 @@ fs_visitor::generate_code()
prog->Name, c->dispatch_width);
}
- 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;
@@ -743,15 +743,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");
@@ -1006,15 +1006,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");
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 667f1e8..f41d633 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
@@ -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++) {
diff --git a/src/mesa/drivers/dri/i965/brw_fs_live_variables.h b/src/mesa/drivers/dri/i965/brw_fs_live_variables.h
index 065f313..5f7e67e 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.h
+++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.h
@@ -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;
--
1.7.10.4
More information about the mesa-dev
mailing list