panfrost: add lcra_free() to free lcra state

Signed-off-by: Urja Rannikko <urjaman@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
Urja Rannikko 2019-12-06 02:41:31 +00:00 committed by Alyssa Rosenzweig
parent 5b6108834b
commit 12e393bacf
3 changed files with 25 additions and 1 deletions

View File

@ -66,6 +66,22 @@ lcra_alloc_equations(
return l;
}
void
lcra_free(struct lcra_state *l)
{
free(l->alignment);
free(l->linear);
free(l->modulus);
free(l->class);
free(l->class_start);
free(l->class_disjoint);
free(l->class_size);
free(l->spill_cost);
free(l->solutions);
free(l);
}
void
lcra_set_alignment(struct lcra_state *l, unsigned node, unsigned align_log2)
{

View File

@ -85,6 +85,8 @@ lcra_alloc_equations(
unsigned min_alignment, unsigned max_alignment,
unsigned bound, unsigned class_count);
void
lcra_free(struct lcra_state *l);
void
lcra_set_disjoint_class(struct lcra_state *l, unsigned c1, unsigned c2);

View File

@ -1427,7 +1427,11 @@ schedule_program(compiler_context *ctx)
mir_squeeze_index(ctx);
mir_invalidate_liveness(ctx);
l = NULL;
if (l) {
lcra_free(l);
l = NULL;
}
l = allocate_registers(ctx, &spilled);
} while(spilled && ((iter_count--) > 0));
@ -1442,4 +1446,6 @@ schedule_program(compiler_context *ctx)
ctx->tls_size = spill_count * 16;
install_registers(ctx, l);
lcra_free(l);
}