summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2015-03-18 16:03:30 +0200
committerFrancisco Jerez <[email protected]>2015-03-23 14:12:13 +0200
commitbf6eb37e0b62fa61c01a32dc5ccb6a7ab00be5f4 (patch)
tree8b7ee98aa880d5a4e6b7ab23da8df1ca63496a10
parent2e7622a48714934411c84cdd8b6576b2b8ce311d (diff)
i965/vec4: Remove dependency of vec4_live_variables on the visitor.
Reviewed-by: Matt Turner <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp11
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_live_variables.h4
2 files changed, 8 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp b/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp
index c562b2e6800..022661dd974 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp
@@ -96,7 +96,7 @@ vec4_live_variables::setup_def_use()
* variable, and thus qualify for being in def[].
*/
if (inst->dst.file == GRF &&
- v->alloc.sizes[inst->dst.reg] == 1 &&
+ alloc.sizes[inst->dst.reg] == 1 &&
!inst->predicate) {
for (int c = 0; c < 4; c++) {
if (inst->dst.writemask & (1 << c)) {
@@ -175,12 +175,13 @@ vec4_live_variables::compute_live_variables()
}
}
-vec4_live_variables::vec4_live_variables(vec4_visitor *v, cfg_t *cfg)
- : v(v), cfg(cfg)
+vec4_live_variables::vec4_live_variables(const simple_allocator &alloc,
+ cfg_t *cfg)
+ : alloc(alloc), cfg(cfg)
{
mem_ctx = ralloc_context(NULL);
- num_vars = v->alloc.count * 4;
+ num_vars = alloc.count * 4;
block_data = rzalloc_array(mem_ctx, struct block_data, cfg->num_blocks);
bitset_words = BITSET_WORDS(num_vars);
@@ -279,7 +280,7 @@ vec4_visitor::calculate_live_intervals()
* The control flow-aware analysis was done at a channel level, while at
* this point we're distilling it down to vgrfs.
*/
- this->live_intervals = new(mem_ctx) vec4_live_variables(this, cfg);
+ this->live_intervals = new(mem_ctx) vec4_live_variables(alloc, cfg);
foreach_block (block, cfg) {
struct block_data *bd = &live_intervals->block_data[block->num];
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_live_variables.h b/src/mesa/drivers/dri/i965/brw_vec4_live_variables.h
index e9d9fa18d0a..c5c6ff391d3 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_live_variables.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4_live_variables.h
@@ -60,7 +60,7 @@ class vec4_live_variables {
public:
DECLARE_RALLOC_CXX_OPERATORS(vec4_live_variables)
- vec4_live_variables(vec4_visitor *v, cfg_t *cfg);
+ vec4_live_variables(const simple_allocator &alloc, cfg_t *cfg);
~vec4_live_variables();
int num_vars;
@@ -73,7 +73,7 @@ protected:
void setup_def_use();
void compute_live_variables();
- vec4_visitor *v;
+ const simple_allocator &alloc;
cfg_t *cfg;
void *mem_ctx;
};