aco/ra: fix get_reg_for_operand() when the blocking var is a vector

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10459>
This commit is contained in:
Rhys Perry 2021-04-23 14:31:04 +01:00 committed by Marge Bot
parent bc95d55e1f
commit c08bfa110c
2 changed files with 18 additions and 1 deletions

View file

@ -1740,7 +1740,7 @@ void get_reg_for_operand(ra_ctx& ctx, RegisterFile& register_file,
uint32_t blocking_id = register_file[operand.physReg()];
RegClass rc = ctx.assignments[blocking_id].rc;
Operand pc_op = Operand(Temp{blocking_id, rc});
pc_op.setFixed(operand.physReg());
pc_op.setFixed(ctx.assignments[blocking_id].reg);
/* make space in the register file for get_reg() and then block the target reg */
register_file.clear(src, operand.regClass());

View file

@ -96,3 +96,20 @@ BEGIN_TEST(regalloc.precolor.swap)
finish_ra_test(ra_test_policy());
END_TEST
BEGIN_TEST(regalloc.precolor.blocking_vector)
//>> s2: %tmp0:s[0-1], s1: %tmp1:s[2] = p_startpgm
if (!setup_cs("s2 s1", GFX10))
return;
//! s2: %tmp0_2:s[2-3], s1: %tmp1_2:s[1] = p_parallelcopy %tmp0:s[0-1], %tmp1:s[2]
//! p_unit_test %tmp1_2:s[1]
Operand op(inputs[1]);
op.setFixed(PhysReg(1));
bld.pseudo(aco_opcode::p_unit_test, op);
//! p_unit_test %tmp0_2:s[2-3]
bld.pseudo(aco_opcode::p_unit_test, inputs[0]);
finish_ra_test(ra_test_policy());
END_TEST