summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Abbott <cwabbott0@gmail.com>2021-05-28 17:31:48 +0200
committerMarge Bot <eric+marge@anholt.net>2021-07-08 16:02:41 +0000
commit43e926a3afadf1503ad1d00b62b10e78520d79ac (patch)
tree13a06c5d3e6a853333964bb8b720d98a36112186
parentbb3212dd4d80fd945654f3ca5380fd472fba92a4 (diff)
ir3/sched: Handle branch condition in split_pred()
Before this, if there was a block with multiple things writing p0.x, it was a tossup whether the right one would be used as the branch condition. Found by inspection. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6752>
-rw-r--r--src/freedreno/ir3/ir3_sched.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/freedreno/ir3/ir3_sched.c b/src/freedreno/ir3/ir3_sched.c
index ee2c817bb73..69e1df08748 100644
--- a/src/freedreno/ir3/ir3_sched.c
+++ b/src/freedreno/ir3/ir3_sched.c
@@ -944,6 +944,16 @@ split_pred(struct ir3_sched_ctx *ctx)
}
}
+ if (ctx->block->condition == ctx->pred) {
+ if (!new_pred) {
+ new_pred = split_instr(ctx, ctx->pred);
+ /* original pred is scheduled, but new one isn't: */
+ new_pred->flags &= ~IR3_INSTR_MARK;
+ }
+ ctx->block->condition = new_pred;
+ d("new branch condition");
+ }
+
/* all remaining predicated remapped to new pred: */
ctx->pred = NULL;