aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-12-03 10:37:01 -0500
committerTomeu Vizoso <[email protected]>2019-12-16 09:10:33 +0000
commit3448b2641a475fce9220ade229570e342882f637 (patch)
treec2d2ffd1aa866d2ee91842e1784ba9da9dfd24d1 /src
parent60396340f5b9bef009e8bc34696a981f5e2b3ae2 (diff)
pan/midgard: Fix liveness analysis with multiple epilogues
Epilogues are special fixed-function blocks, so they need special handling for liveness analysis to work completely. This in turns fixes RA issues for many shaders using MRT. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Visoso <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/panfrost/midgard/compiler.h3
-rw-r--r--src/panfrost/midgard/midgard_compile.c1
-rw-r--r--src/panfrost/midgard/midgard_liveness.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h
index d087579f36d..45a0617a840 100644
--- a/src/panfrost/midgard/compiler.h
+++ b/src/panfrost/midgard/compiler.h
@@ -198,6 +198,9 @@ typedef struct midgard_block {
* simple bit fields, but for us, liveness is a vector idea. */
uint16_t *live_in;
uint16_t *live_out;
+
+ /* Indicates this is a fixed-function fragment epilogue block */
+ bool epilogue;
} midgard_block;
typedef struct midgard_bundle {
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index a118f34fd9a..943435c39ba 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -2217,6 +2217,7 @@ emit_fragment_epilogue(compiler_context *ctx, unsigned rt)
}
EMIT(alu_br_compact_cond, midgard_jmp_writeout_op_writeout, TAG_ALU_4, ~0, midgard_condition_always);
+ ctx->current_block->epilogue = true;
schedule_barrier(ctx);
}
diff --git a/src/panfrost/midgard/midgard_liveness.c b/src/panfrost/midgard/midgard_liveness.c
index 08f8a07bcee..8627e01fa74 100644
--- a/src/panfrost/midgard/midgard_liveness.c
+++ b/src/panfrost/midgard/midgard_liveness.c
@@ -153,7 +153,7 @@ mir_compute_liveness(compiler_context *ctx)
/* If we made progress, we need to process the predecessors */
- if (progress || (blk == exit)) {
+ if (progress || (blk == exit) || blk->epilogue) {
mir_foreach_predecessor(blk, pred)
_mesa_set_add(work_list, pred);
}