From: Alyssa Rosenzweig Date: Thu, 3 Oct 2019 20:01:51 +0000 (-0400) Subject: pan/midgard: Remove mir_has_multiple_writes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c59fae0fef4a4977811384c515ce35319c145708;p=mesa.git pan/midgard: Remove mir_has_multiple_writes We already enforce this with the SSA/register distinction in the backend. There is no need to duplicate this logic merely for an assert. Signed-off-by: Alyssa Rosenzweig --- diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index b0b5ba07143..a338557a7a0 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -604,7 +604,6 @@ void mir_lower_special_reads(compiler_context *ctx); struct ra_graph* allocate_registers(compiler_context *ctx, bool *spilled); void install_registers(compiler_context *ctx, struct ra_graph *g); bool mir_is_live_after(compiler_context *ctx, midgard_block *block, midgard_instruction *start, int src); -bool mir_has_multiple_writes(compiler_context *ctx, int src); void mir_create_pipeline_registers(compiler_context *ctx); diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 857e6c70112..3719ac869b4 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -2146,7 +2146,6 @@ midgard_opt_pos_propagate(compiler_context *ctx, midgard_block *block) /* TODO: Registers? */ unsigned src = ins->src[1]; if (src & IS_REG) continue; - assert(!mir_has_multiple_writes(ctx, src)); /* There might be a source modifier, too */ if (mir_nontrivial_source2_mod(ins)) continue; diff --git a/src/panfrost/midgard/midgard_liveness.c b/src/panfrost/midgard/midgard_liveness.c index 155e1cc3514..4766603a885 100644 --- a/src/panfrost/midgard/midgard_liveness.c +++ b/src/panfrost/midgard/midgard_liveness.c @@ -90,19 +90,3 @@ mir_is_live_after(compiler_context *ctx, midgard_block *block, midgard_instructi return succ; } - -/* Just a quick check -- is it written more than once? (I.e. are we definitely - * not SSA?) */ - -bool -mir_has_multiple_writes(compiler_context *ctx, int dest) -{ - unsigned write_count = 0; - - mir_foreach_instr_global(ctx, ins) { - if (ins->dest == dest) - write_count++; - } - - return write_count > 1; -}