exec_list_make_empty(&impl->body);
exec_list_make_empty(&impl->locals);
- impl->reg_alloc = 0;
impl->ssa_alloc = 0;
impl->num_blocks = 0;
impl->valid_metadata = nir_metadata_none;
/** list for all local variables in the function */
struct exec_list locals;
- /** list of local registers in the function */
- struct exec_list registers;
-
- /** next available local register index */
- unsigned reg_alloc;
-
/** next available SSA value index */
unsigned ssa_alloc;
nir_function_impl *copy = nir_function_impl_clone(b->shader, impl);
exec_list_append(&b->impl->locals, ©->locals);
- exec_list_append(&b->impl->registers, ©->registers);
nir_foreach_block(block, copy) {
nir_foreach_instr_safe(instr, block) {
ralloc_steal(nir, impl);
steal_list(nir, nir_variable, &impl->locals);
- steal_list(nir, nir_register, &impl->registers);
foreach_list_typed(nir_cf_node, cf_node, node, &impl->body) {
sweep_cf_node(nir, cf_node);
if (nir->info.label)
ralloc_steal(nir, (char *)nir->info.label);
- /* Variables and registers are not dead. Steal them back. */
+ /* Variables are not dead. Steal them back. */
steal_list(nir, nir_variable, &nir->variables);
/* Recurse into functions, stealing their contents back. */
/* this gives an approximation/upper limit on how many nodes are needed
* (some ssa values do not represent an allocated register)
*/
- unsigned max_nodes = impl->ssa_alloc + impl->reg_alloc;
+ unsigned max_nodes = impl->ssa_alloc;
unsigned *live_map = ralloc_array(NULL, unsigned, max_nodes);
memset(live_map, 0xff, sizeof(unsigned) * max_nodes);
struct live_def *defs = rzalloc_array(NULL, struct live_def, max_nodes);
struct util_debug_callback *debug)
{
nir_function_impl *func = nir_shader_get_entrypoint(nir);
- assert(func->reg_alloc == 0);
ppir_compiler *comp = ppir_compiler_create(prog, func->ssa_alloc);
if (!comp)
return false;
rzalloc_array(ctx, bi_block *, impl->num_blocks);
ctx->ssa_alloc += impl->ssa_alloc;
- ctx->reg_alloc += impl->reg_alloc;
emit_cf_list(ctx, &impl->body);
bi_emit_phis_deferred(ctx);