summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2014-06-28 20:02:51 -0700
committerMatt Turner <mattst88@gmail.com>2014-07-01 08:55:52 -0700
commit2e90d1fb62a6ef53c15eff76e242c510145178a9 (patch)
tree57ea18f128ff1fa1a4c76a90ad06376d509b6a6b /src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
parentec1b2d6aa075c678f0eb0405be64253450f995a1 (diff)
downloadexternal_mesa3d-2e90d1fb62a6ef53c15eff76e242c510145178a9.zip
external_mesa3d-2e90d1fb62a6ef53c15eff76e242c510145178a9.tar.gz
external_mesa3d-2e90d1fb62a6ef53c15eff76e242c510145178a9.tar.bz2
i965/fs: Pass cfg to calculate_live_intervals().
We've often created the CFG immediately before, so use it when available. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
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.cpp12
1 files changed, 8 insertions, 4 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 0973dc9..585dc3d 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
@@ -243,7 +243,7 @@ fs_live_variables::var_from_reg(fs_reg *reg)
return var_from_vgrf[reg->reg] + reg->reg_offset;
}
-fs_live_variables::fs_live_variables(fs_visitor *v, cfg_t *cfg)
+fs_live_variables::fs_live_variables(fs_visitor *v, const cfg_t *cfg)
: v(v), cfg(cfg)
{
mem_ctx = ralloc_context(NULL);
@@ -304,7 +304,7 @@ fs_visitor::invalidate_live_intervals()
* information about whole VGRFs.
*/
void
-fs_visitor::calculate_live_intervals()
+fs_visitor::calculate_live_intervals(const cfg_t *cfg)
{
if (this->live_intervals)
return;
@@ -320,8 +320,12 @@ fs_visitor::calculate_live_intervals()
virtual_grf_end[i] = -1;
}
- cfg_t cfg(&instructions);
- this->live_intervals = new(mem_ctx) fs_live_variables(this, &cfg);
+ if (cfg) {
+ this->live_intervals = new(mem_ctx) fs_live_variables(this, cfg);
+ } else {
+ cfg_t cfg(&instructions);
+ 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 < live_intervals->num_vars; i++) {