diff --git a/.pick_status.json b/.pick_status.json index 9d2cf1032c8..5e987fd1de5 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -154,7 +154,7 @@ "description": "ir3: update context builder after ir3_get_predicate", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "fda91b49d71dcb7b5368920c3bc97faad0848eb2", "notes": null diff --git a/src/freedreno/ir3/ir3_context.c b/src/freedreno/ir3/ir3_context.c index ba3744a41e4..d93a85c872a 100644 --- a/src/freedreno/ir3/ir3_context.c +++ b/src/freedreno/ir3/ir3_context.c @@ -456,6 +456,16 @@ ir3_get_predicate(struct ir3_context *ctx, struct ir3_instruction *src) } _mesa_hash_table_insert(ctx->predicate_conversions, src, cond); + + /* If we are currently emitting instructions after src, update the context + * builder to point after the predicate conversion. Otherwise, we will insert + * its uses before its def. + */ + if (ctx->build.cursor.option == IR3_CURSOR_AFTER_INSTR && + ctx->build.cursor.instr == src) { + ctx->build = b; + } + return cond; }