ir3: Don't double-insert the first block
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 21 Apr 2020 09:27:46 +0000 (11:27 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 22 Apr 2020 09:49:40 +0000 (09:49 +0000)
The first block was being added to the list twice, once here and once in
emit_block(), leading to list corruption and infinite loops when trying
to traverse the list of blocks backwards.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4658>

src/freedreno/ir3/ir3_compiler_nir.c

index a82faee998e1e98d0c6dc435249ab2562a836b98..fad611c9b5f7d734461db6c4ae2bc735e50ae6e3 100644 (file)
@@ -3262,7 +3262,6 @@ emit_instructions(struct ir3_context *ctx)
        /* Create inputs in first block: */
        ctx->block = get_block(ctx, nir_start_block(fxn));
        ctx->in_block = ctx->block;
-       list_addtail(&ctx->block->node, &ctx->ir->block_list);
 
        /* for fragment shader, the vcoord input register is used as the
         * base for bary.f varying fetch instrs: