From 7df7bab03bf454d20bbfc828619594b8df6b6002 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Mon, 26 Apr 2021 23:07:36 +0200 Subject: [PATCH] ir3/cp: Clone registers for compare-folding optimization Sharing the same register between instructions happened to work with the old RA, but not with the new RA because they may get different register assignments. Part-of: --- src/freedreno/ir3/ir3_cp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/freedreno/ir3/ir3_cp.c b/src/freedreno/ir3/ir3_cp.c index 887a6f45b81..20453da5ef7 100644 --- a/src/freedreno/ir3/ir3_cp.c +++ b/src/freedreno/ir3/ir3_cp.c @@ -563,8 +563,8 @@ instr_cp(struct ir3_cp_ctx *ctx, struct ir3_instruction *instr) instr->flags = cond->flags; instr->cat2 = cond->cat2; ir3_instr_set_address(instr, cond->address); - instr->regs[1] = cond->regs[1]; - instr->regs[2] = cond->regs[2]; + instr->regs[1] = ir3_reg_clone(ctx->shader, cond->regs[1]); + instr->regs[2] = ir3_reg_clone(ctx->shader, cond->regs[2]); instr->barrier_class |= cond->barrier_class; instr->barrier_conflict |= cond->barrier_conflict; unuse(cond);