ir3: Remove loop shared copy check
This is now handled by inserting LCSSA phis similar to how it's handled in ACO. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28573>
This commit is contained in:
@@ -666,7 +666,6 @@ struct ir3_block {
|
||||
uint32_t dom_pre_index;
|
||||
uint32_t dom_post_index;
|
||||
|
||||
uint32_t loop_id;
|
||||
uint32_t loop_depth;
|
||||
|
||||
#if MESA_DEBUG
|
||||
|
||||
@@ -3769,7 +3769,6 @@ emit_block(struct ir3_context *ctx, nir_block *nblock)
|
||||
|
||||
list_addtail(&ctx->block->node, &ctx->ir->block_list);
|
||||
|
||||
ctx->block->loop_id = ctx->loop_id;
|
||||
ctx->block->loop_depth = ctx->loop_depth;
|
||||
|
||||
/* re-emit addr register in each block if needed: */
|
||||
@@ -3926,8 +3925,6 @@ static void
|
||||
emit_loop(struct ir3_context *ctx, nir_loop *nloop)
|
||||
{
|
||||
assert(!nir_loop_has_continue_construct(nloop));
|
||||
unsigned old_loop_id = ctx->loop_id;
|
||||
ctx->loop_id = ctx->so->loops + 1;
|
||||
ctx->loop_depth++;
|
||||
|
||||
struct nir_block *nstart = nir_loop_first_block(nloop);
|
||||
@@ -3948,14 +3945,12 @@ emit_loop(struct ir3_context *ctx, nir_loop *nloop)
|
||||
struct ir3_block *start = get_block(ctx, nstart);
|
||||
ir3_JUMP(continue_blk);
|
||||
continue_blk->successors[0] = start;
|
||||
continue_blk->loop_id = ctx->loop_id;
|
||||
continue_blk->loop_depth = ctx->loop_depth;
|
||||
list_addtail(&continue_blk->node, &ctx->ir->block_list);
|
||||
}
|
||||
|
||||
ctx->so->loops++;
|
||||
ctx->loop_depth--;
|
||||
ctx->loop_id = old_loop_id;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -107,7 +107,6 @@ struct ir3_context {
|
||||
|
||||
unsigned num_arrays;
|
||||
|
||||
unsigned loop_id;
|
||||
unsigned loop_depth;
|
||||
|
||||
/* a common pattern for indirect addressing is to request the
|
||||
|
||||
@@ -304,22 +304,6 @@ try_swap_mad_two_srcs(struct ir3_instruction *instr, unsigned new_flags)
|
||||
return valid_swap;
|
||||
}
|
||||
|
||||
/* Values that are uniform inside a loop can become divergent outside
|
||||
* it if the loop has a divergent trip count. This means that we can't
|
||||
* propagate a copy of a shared to non-shared register if it would
|
||||
* make the shared reg's live range extend outside of its loop. Users
|
||||
* outside the loop would see the value for the thread(s) that last
|
||||
* exited the loop, rather than for their own thread.
|
||||
*/
|
||||
static bool
|
||||
is_valid_shared_copy(struct ir3_instruction *dst_instr,
|
||||
struct ir3_instruction *src_instr,
|
||||
struct ir3_register *src_reg)
|
||||
{
|
||||
return !(src_reg->flags & IR3_REG_SHARED) ||
|
||||
dst_instr->block->loop_id == src_instr->block->loop_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle cp for a given src register. This additionally handles
|
||||
* the cases of collapsing immedate/const (which replace the src
|
||||
@@ -338,9 +322,6 @@ reg_cp(struct ir3_cp_ctx *ctx, struct ir3_instruction *instr,
|
||||
struct ir3_register *src_reg = src->srcs[0];
|
||||
unsigned new_flags = reg->flags;
|
||||
|
||||
if (!is_valid_shared_copy(instr, src, src_reg))
|
||||
return false;
|
||||
|
||||
combine_flags(&new_flags, src);
|
||||
|
||||
if (ir3_valid_flags(instr, n, new_flags)) {
|
||||
@@ -366,9 +347,6 @@ reg_cp(struct ir3_cp_ctx *ctx, struct ir3_instruction *instr,
|
||||
struct ir3_register *src_reg = src->srcs[0];
|
||||
unsigned new_flags = reg->flags;
|
||||
|
||||
if (!is_valid_shared_copy(instr, src, src_reg))
|
||||
return false;
|
||||
|
||||
if (src_reg->flags & IR3_REG_ARRAY)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user