ir3/legalize: Construct branch properly
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 18 Jun 2021 11:56:11 +0000 (13:56 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 23 Jun 2021 17:20:29 +0000 (17:20 +0000)
Don't just yeet stuff into regs without updating regs_count, etc. This
will break horribly during the transition otherwise.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11469>

src/freedreno/ir3/ir3_legalize.c

index 4ffe812..b8ef9bc 100644 (file)
@@ -691,7 +691,8 @@ kill_sched(struct ir3 *ir, struct ir3_shader_variant *so)
                                continue;
 
                        struct ir3_instruction *br = ir3_instr_create(block, OPC_B, 1, 1);
-                       br->regs[1] = instr->regs[1];
+                       ir3_dst_create(br, INVALID_REG, 0);
+                       ir3_src_create(br, instr->regs[1]->num, instr->regs[1]->flags)->wrmask = 1;
                        br->cat0.target =
                                list_last_entry(&ir->block_list, struct ir3_block, node);