mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 19:40:10 +01:00
aco/ra: update_renames() before add_subdword_definition()
The register file tests here should be done after update_renames(). Normally, get_reg() wouldn't have to move anything to make space for a 1-3 byte definition. This was encountered with skip_optimistic_path=true and a get_reg_impl() bug (fixed in a later commit) which caused suboptimal register assignment. 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/34679>
This commit is contained in:
parent
9d0cd43a68
commit
ae6d4f1195
1 changed files with 9 additions and 12 deletions
|
|
@ -3372,19 +3372,16 @@ register_allocation(Program* program, ra_test_policy policy)
|
|||
|
||||
if (!definition->isFixed()) {
|
||||
Temp tmp = definition->getTemp();
|
||||
if (definition->regClass().is_subdword() && definition->bytes() < 4) {
|
||||
PhysReg reg = get_reg(ctx, register_file, tmp, parallelcopy, instr);
|
||||
definition->setFixed(reg);
|
||||
if (reg.byte() || register_file.test(reg, 4)) {
|
||||
bool allow_16bit_write = reg.byte() % 2 == 0 && !register_file.test(reg, 2);
|
||||
add_subdword_definition(program, instr, reg, allow_16bit_write);
|
||||
definition = &instr->definitions[i]; /* add_subdword_definition can invalidate
|
||||
the reference */
|
||||
}
|
||||
} else {
|
||||
definition->setFixed(get_reg(ctx, register_file, tmp, parallelcopy, instr));
|
||||
}
|
||||
PhysReg reg = get_reg(ctx, register_file, tmp, parallelcopy, instr);
|
||||
definition->setFixed(reg);
|
||||
update_renames(ctx, register_file, parallelcopy, instr);
|
||||
if (definition->regClass().is_subdword() && definition->bytes() < 4 &&
|
||||
(reg.byte() || register_file.test(reg, 4))) {
|
||||
bool allow_16bit_write = reg.byte() % 2 == 0 && !register_file.test(reg, 2);
|
||||
add_subdword_definition(program, instr, reg, allow_16bit_write);
|
||||
/* add_subdword_definition can invalidate the reference */
|
||||
definition = &instr->definitions[i];
|
||||
}
|
||||
}
|
||||
|
||||
assert(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue