summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2020-05-28 15:38:04 -0400
committerMarge Bot <eric+marge@anholt.net>2020-05-29 20:34:56 +0000
commit4be2cd604bc601f90eb90625bb91a040659b6767 (patch)
treec0ce662de6d4e4ab34f2cd4987144d4de014076f
parent8230a04f513e033843da2f2e26f87ac3846c4dd7 (diff)
pan/bi: Passthrough deps of the branch target
Now that we have the infrastructure, follow the branch. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5260>
-rw-r--r--src/panfrost/bifrost/bi_pack.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c
index 9a5da020ca7..ecb315fae0a 100644
--- a/src/panfrost/bifrost/bi_pack.c
+++ b/src/panfrost/bifrost/bi_pack.c
@@ -1904,8 +1904,12 @@ bi_pack_clause(bi_context *ctx, bi_clause *clause,
static bi_clause *
bi_next_clause(bi_context *ctx, pan_block *block, bi_clause *clause)
{
+ /* Try the first clause in this block if we're starting from scratch */
+ if (!clause && !list_is_empty(&((bi_block *) block)->clauses))
+ return list_first_entry(&((bi_block *) block)->clauses, bi_clause, link);
+
/* Try the next clause in this block */
- if (clause->link.next != &((bi_block *) block)->clauses)
+ if (clause && clause->link.next != &((bi_block *) block)->clauses)
return list_first_entry(&(clause->link), bi_clause, link);
/* Try the next block, or the one after that if it's empty, etc .*/
@@ -1929,9 +1933,19 @@ bi_pack(bi_context *ctx, struct util_dynarray *emission)
bi_foreach_block(ctx, _block) {
bi_block *block = (bi_block *) _block;
+ /* Passthrough the first clause of where we're branching to for
+ * the last clause of the block (the clause with the branch) */
+
+ bi_clause *succ_clause = block->base.successors[1] ?
+ bi_next_clause(ctx, block->base.successors[0], NULL) : NULL;
+
bi_foreach_clause_in_block(block, clause) {
+ bool is_last = clause->link.next == &block->clauses;
+
bi_clause *next = bi_next_clause(ctx, _block, clause);
- bi_pack_clause(ctx, clause, next, NULL, emission, ctx->stage);
+ bi_clause *next_2 = is_last ? succ_clause : NULL;
+
+ bi_pack_clause(ctx, clause, next, next_2, emission, ctx->stage);
}
}
}