pan/mdg: Free previous liveness
[mesa.git] / src / panfrost / util / pan_liveness.c
index 9772feb1a9c412a719e889ea9e2daf8f80409561..0ec9652b59dc2c8f0fc9e5e8826de8c026bda8f0 100644 (file)
@@ -120,11 +120,13 @@ pan_compute_liveness(
                         _mesa_hash_pointer,
                         _mesa_key_pointer_equal);
 
-        /* Allocate */
+        /* Free any previous liveness, and allocate */
+
+        pan_free_liveness(blocks);
 
         list_for_each_entry(pan_block, block, blocks, link) {
-                block->live_in = rzalloc_array(NULL, uint16_t, temp_count);
-                block->live_out = rzalloc_array(NULL, uint16_t, temp_count);
+                block->live_in = rzalloc_array(block, uint16_t, temp_count);
+                block->live_out = rzalloc_array(block, uint16_t, temp_count);
         }
 
         /* Initialize the work list with the exit block */