struct acp_entry;
}
+namespace brw {
+ class fs_live_variables;
+}
+
class fs_reg {
public:
DECLARE_RALLOC_CXX_OPERATORS(fs_reg)
int virtual_grf_array_size;
int *virtual_grf_start;
int *virtual_grf_end;
- bool live_intervals_valid;
+ brw::fs_live_variables *live_intervals;
/* This is the map from UNIFORM hw_reg + reg_offset as generated by
* the visitor to the packed uniform number after
fs_live_variables::fs_live_variables(fs_visitor *v, cfg_t *cfg)
: v(v), cfg(cfg)
{
- mem_ctx = ralloc_context(cfg->mem_ctx);
+ mem_ctx = this;
num_vgrfs = v->virtual_grf_count;
num_vars = 0;
void
fs_visitor::invalidate_live_intervals()
{
- this->live_intervals_valid = false;
+ ralloc_free(live_intervals);
+ live_intervals = NULL;
}
/**
void
fs_visitor::calculate_live_intervals()
{
- if (this->live_intervals_valid)
+ if (this->live_intervals)
return;
int num_vgrfs = this->virtual_grf_count;
}
cfg_t cfg(this);
- fs_live_variables livevars(this, &cfg);
+ this->live_intervals = new(mem_ctx) fs_live_variables(this, &cfg);
/* Merge the per-component live ranges to whole VGRF live ranges. */
- for (int i = 0; i < livevars.num_vars; i++) {
- int vgrf = livevars.vgrf_from_var[i];
- virtual_grf_start[vgrf] = MIN2(virtual_grf_start[vgrf], livevars.start[i]);
- virtual_grf_end[vgrf] = MAX2(virtual_grf_end[vgrf], livevars.end[i]);
+ for (int i = 0; i < live_intervals->num_vars; i++) {
+ int vgrf = live_intervals->vgrf_from_var[i];
+ virtual_grf_start[vgrf] = MIN2(virtual_grf_start[vgrf],
+ live_intervals->start[i]);
+ virtual_grf_end[vgrf] = MAX2(virtual_grf_end[vgrf],
+ live_intervals->end[i]);
}
-
- this->live_intervals_valid = true;
}
bool
this->virtual_grf_array_size = 0;
this->virtual_grf_start = NULL;
this->virtual_grf_end = NULL;
- this->live_intervals_valid = false;
+ this->live_intervals = NULL;
this->params_remap = NULL;
this->nr_params_remap = 0;