From ba482c2e5fdb2a6d76133b17e2ba2283f1e7474c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Sch=C3=BCrmann?= Date: Tue, 10 Mar 2020 11:50:41 +0100 Subject: [PATCH] aco: improve register assignment when live-range splits are necessary MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When finding a good place for a register, we can ignore killed operands. Reviewed-by: Timur Kristóf Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index a7a44103d27..6863d3877a1 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -641,9 +641,11 @@ std::pair get_reg_impl(ra_ctx& ctx, continue; /* dead operands effectively reduce the number of estimated moves */ - if (remaining_op_moves && reg_file.is_blocked(PhysReg{j})) { - k--; - remaining_op_moves--; + if (reg_file.is_blocked(PhysReg{j})) { + if (remaining_op_moves) { + k--; + remaining_op_moves--; + } continue; } -- 2.30.2