aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-06-05 11:37:22 -0700
committerEric Anholt <[email protected]>2013-10-10 15:54:15 -0700
commitb4d676d71006e5e85893d7b44740860b1b2c3425 (patch)
tree32d1475d213d6f176a2d3eaa080bb5ff157eb156 /src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
parent3ea84beb1687f20074efdb1bcc790370bed2fc65 (diff)
i965/fs: Keep a copy of the live variables class around.
Now optimization passes will be able to look at the per-channel ranges. v2: Rebase on various optimization pass changes. v3 (Kenneth Graunke): Rename live_variables to live_intervals; split introduction of invalidate_live_intervals() into a separate patch. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp21
1 files changed, 11 insertions, 10 deletions
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 497a0db8e94..41176c74236 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
@@ -247,7 +247,7 @@ fs_live_variables::compute_start_end()
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;
@@ -294,7 +294,8 @@ fs_live_variables::~fs_live_variables()
void
fs_visitor::invalidate_live_intervals()
{
- this->live_intervals_valid = false;
+ ralloc_free(live_intervals);
+ live_intervals = NULL;
}
/**
@@ -306,7 +307,7 @@ fs_visitor::invalidate_live_intervals()
void
fs_visitor::calculate_live_intervals()
{
- if (this->live_intervals_valid)
+ if (this->live_intervals)
return;
int num_vgrfs = this->virtual_grf_count;
@@ -321,16 +322,16 @@ fs_visitor::calculate_live_intervals()
}
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