From 43e926a3afadf1503ad1d00b62b10e78520d79ac Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Fri, 28 May 2021 17:31:48 +0200 Subject: 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: --- src/freedreno/ir3/ir3_sched.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; -- cgit v1.2.3