From: Rob Clark Date: Thu, 2 Dec 2021 01:06:20 +0000 (-0800) Subject: freedreno/ir3: Handle instr->address when cloning X-Git-Tag: upstream/22.3.5~14608 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=78c53f48888bf936d41e16b8bcf020beb5c5ff99;p=platform%2Fupstream%2Fmesa.git freedreno/ir3: Handle instr->address when cloning Without this, a cloned instruction that takes full regs will trigger an ir3_validate assert. This can happen, for ex, if an instruction that writes p0.x and has a relative src gets cloned in ir3_sched. Fixes an assert in Genshin Impact with a debug build. Fixes: 9af795d9b98 ("ir3: Make ir3_instruction::address a normal register") Signed-off-by: Rob Clark Part-of: --- diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c index 766a7ad..162a393 100644 --- a/src/freedreno/ir3/ir3.c +++ b/src/freedreno/ir3/ir3.c @@ -493,6 +493,11 @@ ir3_instr_clone(struct ir3_instruction *instr) *new_reg = *reg; } + if (instr->address) { + assert(instr->srcs_count > 0); + new_instr->address = new_instr->srcs[instr->srcs_count - 1]; + } + return new_instr; }