Mesa (master): aco: fix corner case in register allocation
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu May 21 12:21:18 UTC 2020
Module: Mesa
Branch: master
Commit: ae390755fea8b48f63314ecfd2699e1d2c375e76
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ae390755fea8b48f63314ecfd2699e1d2c375e76
Author: Daniel Schürmann <daniel at schuermann.dev>
Date: Sat May 16 17:14:30 2020 +0100
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 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5070>
---
src/amd/compiler/aco_register_allocation.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp
index d296e61de50..f40914e8bf0 100644
--- a/src/amd/compiler/aco_register_allocation.cpp
+++ b/src/amd/compiler/aco_register_allocation.cpp
@@ -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();
}
More information about the mesa-commit
mailing list