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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10591>
This commit is contained in:
Connor Abbott
2021-04-26 23:07:36 +02:00
committed by Marge Bot
parent e597f8b122
commit 7df7bab03b
+2 -2
View File
@@ -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);