aboutsummaryrefslogtreecommitdiffstats
path: root/src/broadcom/compiler/vir_live_variables.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/broadcom/compiler/vir_live_variables.c')
-rw-r--r--src/broadcom/compiler/vir_live_variables.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/broadcom/compiler/vir_live_variables.c b/src/broadcom/compiler/vir_live_variables.c
index 217b716fd9f..20acace1faf 100644
--- a/src/broadcom/compiler/vir_live_variables.c
+++ b/src/broadcom/compiler/vir_live_variables.c
@@ -311,10 +311,20 @@ vir_calculate_live_intervals(struct v3d_compile *c)
{
int bitset_words = BITSET_WORDS(c->num_temps);
- /* If we called this function more than once, then we should be
- * freeing the previous arrays.
+ /* We may be called more than once if we've rearranged the program to
+ * try to get register allocation to succeed.
*/
- assert(!c->temp_start);
+ if (c->temp_start) {
+ ralloc_free(c->temp_start);
+ ralloc_free(c->temp_end);
+
+ vir_for_each_block(block, c) {
+ ralloc_free(block->def);
+ ralloc_free(block->use);
+ ralloc_free(block->live_in);
+ ralloc_free(block->live_out);
+ }
+ }
c->temp_start = rzalloc_array(c, int, c->num_temps);
c->temp_end = rzalloc_array(c, int, c->num_temps);