Mesa (master): aco: don't create vector affinities for operands which are not killed or are duplicates

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 22 18:36:13 UTC 2020


Module: Mesa
Branch: master
Commit: 6792e134f37323d8b56a60b4620e782fc0d673dd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6792e134f37323d8b56a60b4620e782fc0d673dd

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Wed Apr 15 12:05:55 2020 +0100

aco: don't create vector affinities for operands which are not killed or are duplicates

Totals from affected shaders:
SGPRS: 825184 -> 825184 (0.00 %)
VGPRS: 697640 -> 697240 (-0.06 %)
Code Size: 79244104 -> 79201072 (-0.05 %) bytes
Max Waves: 42388 -> 42386 (-0.00 %)

Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4573>

---

 src/amd/compiler/aco_register_allocation.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp
index a6792679da1..a3e01b11c68 100644
--- a/src/amd/compiler/aco_register_allocation.cpp
+++ b/src/amd/compiler/aco_register_allocation.cpp
@@ -1410,7 +1410,7 @@ void register_allocation(Program *program, std::vector<TempSet>& live_out_per_bl
          /* add vector affinities */
          if (instr->opcode == aco_opcode::p_create_vector) {
             for (const Operand& op : instr->operands) {
-               if (op.isTemp() && op.getTemp().type() == instr->definitions[0].getTemp().type())
+               if (op.isTemp() && op.isFirstKill() && op.getTemp().type() == instr->definitions[0].getTemp().type())
                   ctx.vectors[op.tempId()] = instr.get();
             }
          }



More information about the mesa-commit mailing list