aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-10-29 13:58:45 -0700
committerMatt Turner <[email protected]>2014-12-01 16:42:13 -0800
commitb37273b92431a2d986235774f04a9fba2aa1bf74 (patch)
tree60e2fe60bb77359d6d6cf8aa739ae1190d65a564 /src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
parent60d507c3c5c7caed57119df0ab4d824ad1ea85dc (diff)
i965/fs: Use const fs_reg & rather than a copy or pointer.
Also while we're touching var_from_reg, just make it an inline function. 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.cpp14
1 files changed, 4 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 2512b799f03..189a119025d 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
@@ -54,9 +54,9 @@ using namespace brw;
void
fs_live_variables::setup_one_read(struct block_data *bd, fs_inst *inst,
- int ip, fs_reg reg)
+ int ip, const fs_reg &reg)
{
- int var = var_from_reg(&reg);
+ int var = var_from_reg(reg);
assert(var < num_vars);
/* In most cases, a register can be written over safely by the
@@ -106,9 +106,9 @@ fs_live_variables::setup_one_read(struct block_data *bd, fs_inst *inst,
void
fs_live_variables::setup_one_write(struct block_data *bd, fs_inst *inst,
- int ip, fs_reg reg)
+ int ip, const fs_reg &reg)
{
- int var = var_from_reg(&reg);
+ int var = var_from_reg(reg);
assert(var < num_vars);
start[var] = MIN2(start[var], ip);
@@ -273,12 +273,6 @@ fs_live_variables::compute_start_end()
}
}
-int
-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, const cfg_t *cfg)
: v(v), cfg(cfg)
{