aco: improve register assignment when live-range splits are necessary
authorDaniel Schürmann <daniel@schuermann.dev>
Tue, 10 Mar 2020 10:50:41 +0000 (11:50 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 9 Apr 2020 15:08:57 +0000 (15:08 +0000)
When finding a good place for a register, we can ignore
killed operands.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4130>

src/amd/compiler/aco_register_allocation.cpp

index a7a44103d27cc537596ef6ac269cbd5affde2f7a..6863d3877a130adbedc2b66f0ea2997e7d460a41 100644 (file)
@@ -641,9 +641,11 @@ std::pair<PhysReg, bool> 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;
          }