Mesa (staging/21.3): aco/ra: fix get_reg_for_operand() in case of stride mismatches

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 23 22:57:40 UTC 2021


Module: Mesa
Branch: staging/21.3
Commit: b54c371f4c216adbf609902b2d2ada7b6ecad8ee
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b54c371f4c216adbf609902b2d2ada7b6ecad8ee

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Tue Dec 21 12:17:24 2021 +0100

aco/ra: fix get_reg_for_operand() in case of stride mismatches

We have to clear the register file from the previous operand
as otherwise, there might be no space left.

Totals from 5 (0.00% of 134572) affected shaders: (GFX10.3)
CodeSize: 21144 -> 21000 (-0.68%); split: -0.72%, +0.04%
Instrs: 3738 -> 3720 (-0.48%); split: -0.51%, +0.03%
Latency: 517229 -> 516319 (-0.18%); split: -0.18%, +0.00%
InvThroughput: 49068 -> 48902 (-0.34%); split: -0.38%, +0.04%
Copies: 501 -> 483 (-3.59%); split: -3.79%, +0.20%

Cc: mesa-stable
Reviewed-by: Timur Kristóf <timur.kristof at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14279>
(cherry picked from commit d36a43598c2dd2c490e8e8cb901d067fa56aeb8d)

---

 .pick_status.json                            | 2 +-
 src/amd/compiler/aco_register_allocation.cpp | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 6f727902bb0..25b3aeb4dc8 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -382,7 +382,7 @@
         "description": "aco/ra: fix get_reg_for_operand() in case of stride mismatches",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp
index a037745aaaf..4ee339b9838 100644
--- a/src/amd/compiler/aco_register_allocation.cpp
+++ b/src/amd/compiler/aco_register_allocation.cpp
@@ -1898,10 +1898,9 @@ get_reg_for_operand(ra_ctx& ctx, RegisterFile& register_file,
       dst = operand.physReg();
 
    } else {
+      /* clear the operand in case it's only a stride mismatch */
+      register_file.clear(src, operand.regClass());
       dst = get_reg(ctx, register_file, operand.getTemp(), parallelcopy, instr, operand_index);
-      update_renames(
-         ctx, register_file, parallelcopy, instr,
-         instr->opcode != aco_opcode::p_create_vector ? rename_not_killed_ops : (UpdateRenames)0);
    }
 
    Operand pc_op = operand;



More information about the mesa-commit mailing list