ac/llvm: add better code for fsign
[mesa.git] / src / panfrost / util / pan_liveness.c
index 48ec71b253aa4a0c665fd7b2a804981af3e4c486..0ec9652b59dc2c8f0fc9e5e8826de8c026bda8f0 100644 (file)
@@ -104,14 +104,6 @@ liveness_block_update(
  * adding the predecessors of the block to the work list if we made progress.
  */
 
-static inline pan_block *
-pan_exit_block(struct list_head *blocks)
-{
-        pan_block *last = list_last_entry(blocks, pan_block, link);
-        assert(last->nr_successors == 0);
-        return last;
-}
-
 void
 pan_compute_liveness(
                 struct list_head *blocks,
@@ -128,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 */