i965/nir/fs: removed unneeded support for global variables

As functions are inlined, and nir_lower_global_vars_to_local gets
run, all global variables are lowered to local variables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Alejandro Piñeiro 2015-07-17 11:54:34 +02:00 committed by Iago Toral Quiroga
parent 801d41fa43
commit 8ba1982b1e
3 changed files with 4 additions and 14 deletions

View file

@ -371,7 +371,6 @@ public:
fs_reg *nir_locals;
fs_reg *nir_ssa_values;
fs_reg *nir_globals;
fs_reg nir_inputs;
fs_reg nir_outputs;
fs_reg *nir_system_values;

View file

@ -55,14 +55,6 @@ fs_visitor::emit_nir_code()
nir_emit_system_values(nir);
nir_globals = ralloc_array(mem_ctx, fs_reg, nir->reg_alloc);
foreach_list_typed(nir_register, reg, node, &nir->registers) {
unsigned array_elems =
reg->num_array_elems == 0 ? 1 : reg->num_array_elems;
unsigned size = array_elems * reg->num_components;
nir_globals[reg->index] = bld.vgrf(BRW_REGISTER_TYPE_F, size);
}
/* get the main function and emit it */
nir_foreach_overload(nir, overload) {
assert(strcmp(overload->function->name, "main") == 0);
@ -1159,10 +1151,10 @@ fs_reg_for_nir_reg(fs_visitor *v, nir_register *nir_reg,
unsigned base_offset, nir_src *indirect)
{
fs_reg reg;
if (nir_reg->is_global)
reg = v->nir_globals[nir_reg->index];
else
reg = v->nir_locals[nir_reg->index];
assert(!nir_reg->is_global);
reg = v->nir_locals[nir_reg->index];
reg = offset(reg, v->bld, base_offset * nir_reg->num_components);
if (indirect) {

View file

@ -2029,7 +2029,6 @@ fs_visitor::fs_visitor(const struct brw_compiler *compiler, void *log_data,
this->nir_locals = NULL;
this->nir_ssa_values = NULL;
this->nir_globals = NULL;
memset(&this->payload, 0, sizeof(this->payload));
memset(this->outputs, 0, sizeof(this->outputs));