aco: fix corner case in register allocation

We mark dead operands in the register file when searching for
a register for a definition. Only do so, if this space has not
yet been taken by a different definition.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5070>
This commit is contained in:
Daniel Schürmann
2020-05-16 17:14:30 +01:00
committed by Marge Bot
parent acec00eae0
commit ae390755fe
+2 -2
View File
@@ -700,9 +700,9 @@ std::pair<PhysReg, bool> get_reg_impl(ra_ctx& ctx,
if (instr->operands[j].isTemp() &&
instr->operands[j].isFirstKillBeforeDef() &&
instr->operands[j].physReg() >= lb &&
instr->operands[j].physReg() < ub) {
instr->operands[j].physReg() < ub &&
!reg_file.test(instr->operands[j].physReg(), instr->operands[j].bytes())) {
assert(instr->operands[j].isFixed());
assert(!reg_file.test(instr->operands[j].physReg(), instr->operands[j].bytes()));
reg_file.block(instr->operands[j].physReg(), instr->operands[j].regClass());
killed_ops += instr->operands[j].getTemp().size();
}