mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
i965/fs: Remove dependency of fs_inst on the visitor class.
The fs_visitor argument of fs_inst::regs_read() wasn't used at all. Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
bfbb0e84e1
commit
a3ee6c7d19
7 changed files with 12 additions and 13 deletions
|
|
@ -916,7 +916,7 @@ fs_inst::is_partial_write() const
|
|||
}
|
||||
|
||||
int
|
||||
fs_inst::regs_read(fs_visitor *v, int arg) const
|
||||
fs_inst::regs_read(int arg) const
|
||||
{
|
||||
if (is_tex() && arg == 0 && src[0].file == GRF) {
|
||||
return mlen;
|
||||
|
|
@ -1953,7 +1953,7 @@ fs_visitor::split_virtual_grfs()
|
|||
for (int i = 0; i < inst->sources; i++) {
|
||||
if (inst->src[i].file == GRF) {
|
||||
int reg = vgrf_to_reg[inst->src[i].reg] + inst->src[i].reg_offset;
|
||||
for (int j = 1; j < inst->regs_read(this, i); j++)
|
||||
for (int j = 1; j < inst->regs_read(i); j++)
|
||||
split_points[reg + j] = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry)
|
|||
*/
|
||||
if (inst->src[arg].reg_offset < entry->dst.reg_offset ||
|
||||
(inst->src[arg].reg_offset * 32 + inst->src[arg].subreg_offset +
|
||||
inst->regs_read(this, arg) * inst->src[arg].stride * 32) >
|
||||
inst->regs_read(arg) * inst->src[arg].stride * 32) >
|
||||
(entry->dst.reg_offset + entry->regs_written) * 32)
|
||||
return false;
|
||||
|
||||
|
|
@ -444,7 +444,7 @@ fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry)
|
|||
*/
|
||||
if (inst->src[i].reg_offset < entry->dst.reg_offset ||
|
||||
(inst->src[i].reg_offset * 32 + inst->src[i].subreg_offset +
|
||||
inst->regs_read(this, i) * inst->src[i].stride * 32) >
|
||||
inst->regs_read(i) * inst->src[i].stride * 32) >
|
||||
(entry->dst.reg_offset + entry->regs_written) * 32)
|
||||
continue;
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ fs_visitor::dead_code_eliminate()
|
|||
if (inst->src[i].file == GRF) {
|
||||
int var = live_intervals->var_from_reg(inst->src[i]);
|
||||
|
||||
for (int j = 0; j < inst->regs_read(this, i); j++) {
|
||||
for (int j = 0; j < inst->regs_read(i); j++) {
|
||||
BITSET_SET(live, var + j);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ fs_live_variables::setup_def_use()
|
|||
if (reg.file != GRF)
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < inst->regs_read(v, i); j++) {
|
||||
for (int j = 0; j < inst->regs_read(i); j++) {
|
||||
setup_one_read(bd, inst, ip, reg);
|
||||
reg.reg_offset++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -859,7 +859,7 @@ fs_visitor::spill_reg(int spill_reg)
|
|||
for (unsigned int i = 0; i < inst->sources; i++) {
|
||||
if (inst->src[i].file == GRF &&
|
||||
inst->src[i].reg == spill_reg) {
|
||||
int regs_read = inst->regs_read(this, i);
|
||||
int regs_read = inst->regs_read(i);
|
||||
int subset_spill_offset = (spill_offset +
|
||||
REG_SIZE * inst->src[i].reg_offset);
|
||||
fs_reg unspill_dst(GRF, alloc.allocate(regs_read));
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
#include "brw_shader.h"
|
||||
|
||||
class fs_inst;
|
||||
class fs_visitor;
|
||||
|
||||
class fs_reg : public backend_reg {
|
||||
public:
|
||||
|
|
@ -222,7 +221,7 @@ public:
|
|||
bool overwrites_reg(const fs_reg ®) const;
|
||||
bool is_send_from_grf() const;
|
||||
bool is_partial_write() const;
|
||||
int regs_read(fs_visitor *v, int arg) const;
|
||||
int regs_read(int arg) const;
|
||||
bool can_do_source_mods(struct brw_context *brw);
|
||||
|
||||
bool reads_flag() const;
|
||||
|
|
|
|||
|
|
@ -793,10 +793,10 @@ fs_instruction_scheduler::calculate_deps()
|
|||
for (int i = 0; i < inst->sources; i++) {
|
||||
if (inst->src[i].file == GRF) {
|
||||
if (post_reg_alloc) {
|
||||
for (int r = 0; r < inst->regs_read(v, i); r++)
|
||||
for (int r = 0; r < inst->regs_read(i); r++)
|
||||
add_dep(last_grf_write[inst->src[i].reg + r], n);
|
||||
} else {
|
||||
for (int r = 0; r < inst->regs_read(v, i); r++) {
|
||||
for (int r = 0; r < inst->regs_read(i); r++) {
|
||||
add_dep(last_grf_write[inst->src[i].reg * 16 + inst->src[i].reg_offset + r], n);
|
||||
}
|
||||
}
|
||||
|
|
@ -922,10 +922,10 @@ fs_instruction_scheduler::calculate_deps()
|
|||
for (int i = 0; i < inst->sources; i++) {
|
||||
if (inst->src[i].file == GRF) {
|
||||
if (post_reg_alloc) {
|
||||
for (int r = 0; r < inst->regs_read(v, i); r++)
|
||||
for (int r = 0; r < inst->regs_read(i); r++)
|
||||
add_dep(n, last_grf_write[inst->src[i].reg + r]);
|
||||
} else {
|
||||
for (int r = 0; r < inst->regs_read(v, i); r++) {
|
||||
for (int r = 0; r < inst->regs_read(i); r++) {
|
||||
add_dep(n, last_grf_write[inst->src[i].reg * 16 + inst->src[i].reg_offset + r]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue