Mesa (main): ir3/ra: Remove logical_unreachable

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 20 10:57:10 UTC 2021


Module: Mesa
Branch: main
Commit: f40baf33e66bacc006afc56d4d334037d6c9a02f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f40baf33e66bacc006afc56d4d334037d6c9a02f

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Fri Jul 23 14:34:39 2021 +0200

ir3/ra: Remove logical_unreachable

This reverts 394c597b1b31842b3943e30ab7f21359b0076b13, although I had to
manually do it due to the reformatting.

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

---

 src/freedreno/ir3/ir3_ra.c | 29 +----------------------------
 1 file changed, 1 insertion(+), 28 deletions(-)

diff --git a/src/freedreno/ir3/ir3_ra.c b/src/freedreno/ir3/ir3_ra.c
index 6463b62ed2a..dd8d4adab2d 100644
--- a/src/freedreno/ir3/ir3_ra.c
+++ b/src/freedreno/ir3/ir3_ra.c
@@ -301,12 +301,6 @@ struct ra_block_state {
    /* True if the block has been visited and "renames" is complete.
     */
    bool visited;
-
-   /* True if the block is unreachable via the logical CFG. This happens for
-    * blocks after an if where both sides end in a break/continue. We ignore
-    * it for everything but shared registers.
-    */
-   bool logical_unreachable;
 };
 
 struct ra_parallel_copy {
@@ -328,8 +322,6 @@ struct ra_ctx {
    /* Shared regs. */
    struct ra_file shared;
 
-   struct ir3 *ir;
-
    struct ir3_liveness *live;
 
    struct ir3_block *block;
@@ -1538,8 +1530,7 @@ handle_live_in(struct ra_ctx *ctx, struct ir3_register *def)
       struct ir3_block *pred = ctx->block->predecessors[i];
       struct ra_block_state *pred_state = &ctx->blocks[pred->index];
 
-      if (!pred_state->visited ||
-          (pred_state->logical_unreachable && !(def->flags & IR3_REG_SHARED)))
+      if (!pred_state->visited)
          continue;
 
       physreg = read_register(ctx, pred, def);
@@ -1839,21 +1830,6 @@ handle_block(struct ra_ctx *ctx, struct ir3_block *block)
    ra_file_init(&ctx->half);
    ra_file_init(&ctx->shared);
 
-   bool unreachable = false;
-   if (block != ir3_start_block(ctx->ir)) {
-      unreachable = true;
-      for (unsigned i = 0; i < block->predecessors_count; i++) {
-         struct ra_block_state *pred_state =
-            &ctx->blocks[block->predecessors[i]->index];
-         if (!pred_state->logical_unreachable) {
-            unreachable = false;
-            break;
-         }
-      }
-   }
-
-   ctx->blocks[block->index].logical_unreachable = unreachable;
-
    /* Handle live-ins, phis, and input meta-instructions. These all appear
     * live at the beginning of the block, and interfere with each other
     * therefore need to be allocated "in parallel". This means that we
@@ -1878,8 +1854,6 @@ handle_block(struct ra_ctx *ctx, struct ir3_block *block)
    BITSET_FOREACH_SET (name, ctx->live->live_in[block->index],
                        ctx->live->definitions_count) {
       struct ir3_register *reg = ctx->live->definitions[name];
-      if (unreachable && !(reg->flags & IR3_REG_SHARED))
-         continue;
       handle_live_in(ctx, reg);
    }
 
@@ -2007,7 +1981,6 @@ ir3_ra(struct ir3_shader_variant *v)
 
    struct ra_ctx *ctx = rzalloc(NULL, struct ra_ctx);
 
-   ctx->ir = v->ir;
    ctx->merged_regs = v->mergedregs;
    ctx->compiler = v->shader->compiler;
    ctx->stage = v->type;



More information about the mesa-commit mailing list