Revert "panfrost: Free all block/instruction objects before leaving midgard_compile_s...
authorBoris Brezillon <boris.brezillon@collabora.com>
Tue, 27 Aug 2019 18:07:03 +0000 (20:07 +0200)
committerBoris Brezillon <boris.brezillon@collabora.com>
Tue, 27 Aug 2019 18:07:28 +0000 (20:07 +0200)
This reverts commit 5882e0def97a47aff050f5a3f412b97a7f440e27.

This commit causes a segfault.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
src/panfrost/midgard/compiler.h
src/panfrost/midgard/midgard_compile.c

index d131bb8c1915f67af538dea50666fe2981de7994..f9ba31b5959d079d40e28a8b10910920efba7ac2 100644 (file)
@@ -333,9 +333,6 @@ mir_next_op(struct midgard_instruction *ins)
 #define mir_foreach_block(ctx, v) \
         list_for_each_entry(struct midgard_block, v, &ctx->blocks, link)
 
-#define mir_foreach_block_safe(ctx, v) \
-        list_for_each_entry_safe(struct midgard_block, v, &ctx->blocks, link)
-
 #define mir_foreach_block_from(ctx, from, v) \
         list_for_each_entry_from(struct midgard_block, v, from, &ctx->blocks, link)
 
@@ -395,15 +392,6 @@ mir_next_op(struct midgard_instruction *ins)
 #define mir_foreach_src(ins, v) \
         for (unsigned v = 0; v < ARRAY_SIZE(ins->src); ++v)
 
-static inline void mir_remove_block(struct midgard_block *block)
-{
-        mir_foreach_instr_in_block_safe(block, ins)
-                mir_remove_instruction(ins);
-
-        list_del(&block->link);
-        free(block);
-}
-
 static inline midgard_instruction *
 mir_last_in_block(struct midgard_block *block)
 {
index 56a752433143983925a2df2eec4a663e3ecd93b6..74511b278d16527328a212b4479619c58b339422 100644 (file)
@@ -2835,9 +2835,6 @@ midgard_compile_shader_nir(struct midgard_screen *screen, nir_shader *nir, midga
                         ctx->spills, ctx->fills);
         }
 
-        mir_foreach_block_safe(ctx, block)
-                mir_remove_block(block);
-
         ralloc_free(ctx);
 
         return 0;