i965/vec4: Remove dependency of vec4_live_variables on the visitor.

Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
Francisco Jerez 2015-03-18 16:03:30 +02:00
parent 2e7622a487
commit bf6eb37e0b
2 changed files with 8 additions and 7 deletions

View file

@ -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];

View file

@ -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;
};