[Mesa-dev] [PATCH 19/30] i965/fs: Pass single backend_shader argument to the fs_live_variables constructor.
Francisco Jerez
currojerez at riseup.net
Mon Mar 14 03:47:23 UTC 2016
This removes the dependency of fs_live_variables on fs_visitor. The
IR analysis framework requires the analysis result to be constructible
with a single argument -- The second argument was redundant anyway.
---
src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp | 12 ++++++------
src/mesa/drivers/dri/i965/brw_fs_live_variables.h | 6 ++----
2 files changed, 8 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 6da026e..4b0943f 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
@@ -238,22 +238,22 @@ fs_live_variables::compute_start_end()
}
}
-fs_live_variables::fs_live_variables(fs_visitor *v, const cfg_t *cfg)
- : v(v), cfg(cfg)
+fs_live_variables::fs_live_variables(const backend_shader *s)
+ : cfg(s->cfg)
{
mem_ctx = ralloc_context(NULL);
- num_vgrfs = v->alloc.count;
+ num_vgrfs = s->alloc.count;
num_vars = 0;
var_from_vgrf = rzalloc_array(mem_ctx, int, num_vgrfs);
for (int i = 0; i < num_vgrfs; i++) {
var_from_vgrf[i] = num_vars;
- num_vars += v->alloc.sizes[i];
+ num_vars += s->alloc.sizes[i];
}
vgrf_from_var = rzalloc_array(mem_ctx, int, num_vars);
for (int i = 0; i < num_vgrfs; i++) {
- for (unsigned j = 0; j < v->alloc.sizes[i]; j++) {
+ for (unsigned j = 0; j < s->alloc.sizes[i]; j++) {
vgrf_from_var[var_from_vgrf[i] + j] = i;
}
}
@@ -323,7 +323,7 @@ fs_visitor::calculate_live_intervals()
if (this->live_intervals)
return;
- this->live_intervals = new(mem_ctx) fs_live_variables(this, cfg);
+ this->live_intervals = new(mem_ctx) fs_live_variables(this);
}
bool
diff --git a/src/mesa/drivers/dri/i965/brw_fs_live_variables.h b/src/mesa/drivers/dri/i965/brw_fs_live_variables.h
index c0943c7..e1cd12c 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.h
+++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.h
@@ -32,7 +32,7 @@
#include "util/bitset.h"
struct cfg_t;
-class fs_visitor;
+struct backend_shader;
namespace brw {
@@ -66,7 +66,7 @@ public:
DECLARE_RALLOC_CXX_OPERATORS(fs_live_variables)
- fs_live_variables(fs_visitor *v, const cfg_t *cfg);
+ fs_live_variables(const backend_shader *s);
~fs_live_variables();
bool vars_interfere(int a, int b) const;
@@ -118,10 +118,8 @@ protected:
void compute_live_variables();
void compute_start_end();
- fs_visitor *v;
const cfg_t *cfg;
void *mem_ctx;
-
};
} /* namespace brw */
--
2.7.0
More information about the mesa-dev
mailing list