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>
This commit is contained in:
Connor Abbott
2021-05-28 17:31:48 +02:00
committed by Marge Bot
parent bb3212dd4d
commit 43e926a3af

View File

@@ -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;