Signed-off-by: Urja Rannikko <urjaman@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
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)
{
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);
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));
ctx->tls_size = spill_count * 16;
install_registers(ctx, l);
+
+ lcra_free(l);
}