Mesa (main): pan/bi: Clean up liveness freeing
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sun Jul 18 02:03:17 UTC 2021
Module: Mesa
Branch: main
Commit: bbf2ef6b4a60d8aa3c45c22ebb8ae68e56b8b548
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bbf2ef6b4a60d8aa3c45c22ebb8ae68e56b8b548
Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date: Fri Jul 16 18:43:19 2021 -0400
pan/bi: Clean up liveness freeing
This is ralloc'd, kind of pointless.
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11936>
---
src/panfrost/bifrost/bi_liveness.c | 26 +++++---------------------
1 file changed, 5 insertions(+), 21 deletions(-)
diff --git a/src/panfrost/bifrost/bi_liveness.c b/src/panfrost/bifrost/bi_liveness.c
index b6796a566a4..49297081543 100644
--- a/src/panfrost/bifrost/bi_liveness.c
+++ b/src/panfrost/bifrost/bi_liveness.c
@@ -88,21 +88,6 @@ liveness_block_update(bi_block *blk, unsigned temp_count)
* adding the predecessors of the block to the work list if we made progress.
*/
-static void
-free_liveness(struct list_head *blocks)
-{
- list_for_each_entry(bi_block, block, blocks, link) {
- if (block->live_in)
- ralloc_free(block->live_in);
-
- if (block->live_out)
- ralloc_free(block->live_out);
-
- block->live_in = NULL;
- block->live_out = NULL;
- }
-}
-
void
bi_compute_liveness(bi_context *ctx)
{
@@ -120,11 +105,13 @@ bi_compute_liveness(bi_context *ctx)
_mesa_hash_pointer,
_mesa_key_pointer_equal);
- /* Free any previous liveness, and allocate */
+ list_for_each_entry(bi_block, block, &ctx->blocks, link) {
+ if (block->live_in)
+ ralloc_free(block->live_in);
- free_liveness(&ctx->blocks);
+ if (block->live_out)
+ ralloc_free(block->live_out);
- list_for_each_entry(bi_block, block, &ctx->blocks, link) {
block->live_in = rzalloc_array(block, uint16_t, temp_count);
block->live_out = rzalloc_array(block, uint16_t, temp_count);
}
@@ -165,8 +152,5 @@ bi_compute_liveness(bi_context *ctx)
void
bi_invalidate_liveness(bi_context *ctx)
{
- if (ctx->has_liveness)
- free_liveness(&ctx->blocks);
-
ctx->has_liveness = false;
}
More information about the mesa-commit
mailing list