diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-10-03 21:29:59 -0400 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-10-03 22:29:51 -0400 |
commit | ad5fcac005876b5e743281b4198b55a0886fbe0d (patch) | |
tree | 56e64b1eae12de028b549708d324ea9de5e850be /src | |
parent | 3450c013c5a90c1689287c69aaf0e41eae147bc3 (diff) |
pan/midgard: Invalidate liveness for mir_is_live_after
Callers should have liveness info ready. Ideally we'd have a nice
metadata tracking framework like NIR to handle this automatically, but
for now this will allow us to make forward progress... when we're about
to do something with liveness, invalidate everything ahead to force a
clean calculation.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/panfrost/midgard/midgard_liveness.c | 2 | ||||
-rw-r--r-- | src/panfrost/midgard/midgard_opt_dce.c | 2 | ||||
-rw-r--r-- | src/panfrost/midgard/midgard_ra_pipeline.c | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/src/panfrost/midgard/midgard_liveness.c b/src/panfrost/midgard/midgard_liveness.c index b432ca43b47..4aceab7e3bc 100644 --- a/src/panfrost/midgard/midgard_liveness.c +++ b/src/panfrost/midgard/midgard_liveness.c @@ -226,6 +226,8 @@ is_live_after_successors(compiler_context *ctx, midgard_block *bl, int src) bool mir_is_live_after(compiler_context *ctx, midgard_block *block, midgard_instruction *start, int src) { + assert(ctx->metadata & MIDGARD_METADATA_LIVENESS); + /* Check the rest of the block for liveness */ mir_foreach_instr_in_block_from(block, ins, mir_next_op(start)) { diff --git a/src/panfrost/midgard/midgard_opt_dce.c b/src/panfrost/midgard/midgard_opt_dce.c index 764a5ff6030..613eb6e5b1d 100644 --- a/src/panfrost/midgard/midgard_opt_dce.c +++ b/src/panfrost/midgard/midgard_opt_dce.c @@ -31,6 +31,8 @@ midgard_opt_dead_code_eliminate(compiler_context *ctx, midgard_block *block) { bool progress = false; + mir_invalidate_liveness(ctx); + mir_foreach_instr_in_block_safe(block, ins) { if (ins->type != TAG_ALU_4) continue; if (ins->compact_branch) continue; diff --git a/src/panfrost/midgard/midgard_ra_pipeline.c b/src/panfrost/midgard/midgard_ra_pipeline.c index 1dea92d053a..3fa3e9fbecd 100644 --- a/src/panfrost/midgard/midgard_ra_pipeline.c +++ b/src/panfrost/midgard/midgard_ra_pipeline.c @@ -106,6 +106,8 @@ mir_pipeline_ins( void mir_create_pipeline_registers(compiler_context *ctx) { + mir_invalidate_liveness(ctx); + mir_foreach_block(ctx, block) { mir_foreach_bundle_in_block(block, bundle) { if (!mir_is_alu_bundle(bundle)) continue; |