nir/tests: Fix transmuting an SSA dest to be non-SSA

With the de-ralloc changes, having the register dest not have its .reg
properly initialized caused crashes.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11776>
This commit is contained in:
Emma Anholt 2021-08-13 15:07:15 -07:00 committed by Marge Bot
parent 1edff520e2
commit feee5e6974

View file

@ -306,7 +306,8 @@ TEST_F(alu_srcs_negative_equal_test, unused_components_mismatch)
nir_alu_instr *instr = nir_instr_as_alu(result->parent_instr);
/* Disable the channels that aren't negations of each other. */
instr->dest.dest.is_ssa = false;
nir_register *reg = nir_local_reg_create(bld.impl);
nir_instr_rewrite_dest(&instr->instr, &instr->dest.dest, nir_dest_for_reg(reg));
instr->dest.write_mask = 8 + 1;
EXPECT_TRUE(nir_alu_srcs_negative_equal(instr, instr, 0, 1));