aco/ra: use get_reg_specified() for p_extract_vector

On GFX6/7, it might violate validation rules, otherwise.

Fixes: 51f4b22fee ('aco: don't allow unaligned subdword accesses on GFX6/7')
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8047>
This commit is contained in:
Daniel Schürmann 2020-12-11 09:23:04 +01:00 committed by Marge Bot
parent 731f8fc9dd
commit fd49ba59a3
1 changed files with 3 additions and 7 deletions

View File

@ -2172,14 +2172,10 @@ void register_allocation(Program *program, std::vector<IDSet>& live_out_per_bloc
!register_file.test(reg, definition->bytes()))
definition->setFixed(reg);
} else if (instr->opcode == aco_opcode::p_extract_vector) {
PhysReg reg;
if (instr->operands[0].isKillBeforeDef() &&
instr->operands[0].getTemp().type() == definition->getTemp().type()) {
reg = instr->operands[0].physReg();
reg.reg_b += definition->bytes() * instr->operands[1].constantValue();
assert(!register_file.test(reg, definition->bytes()));
PhysReg reg = instr->operands[0].physReg();
reg.reg_b += definition->bytes() * instr->operands[1].constantValue();
if (get_reg_specified(ctx, register_file, definition->regClass(), parallelcopy, instr, reg))
definition->setFixed(reg);
}
} else if (instr->opcode == aco_opcode::p_create_vector) {
PhysReg reg = get_reg_create_vector(ctx, register_file, definition->getTemp(),
parallelcopy, instr);