Mesa (main): aco/optimizer: apply extract from subdword p_split_vector

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Dec 31 15:13:09 UTC 2021


Module: Mesa
Branch: main
Commit: 91f17e1c7311664a0efc6d07ae1e05df3febbd2c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=91f17e1c7311664a0efc6d07ae1e05df3febbd2c

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Mon Oct 25 16:44:42 2021 +0200

aco/optimizer: apply extract from subdword p_split_vector

Totals from 1345 (1.00% of 134572) affected shaders: (GFX10.3)
VGPRs: 76752 -> 76744 (-0.01%); split: -0.02%, +0.01%
SpillSGPRs: 1459 -> 1460 (+0.07%)
SpillVGPRs: 1776 -> 1784 (+0.45%); split: -0.39%, +0.84%
CodeSize: 13310964 -> 13309420 (-0.01%); split: -0.06%, +0.05%
Scratch: 178176 -> 179200 (+0.57%)
Instrs: 2516874 -> 2516860 (-0.00%); split: -0.05%, +0.05%
Latency: 23228506 -> 23230338 (+0.01%); split: -0.14%, +0.15%
InvThroughput: 6002384 -> 6000158 (-0.04%); split: -0.24%, +0.21%
VClause: 41115 -> 41117 (+0.00%); split: -0.28%, +0.29%
SClause: 104639 -> 104664 (+0.02%); split: -0.07%, +0.09%
Copies: 185121 -> 184862 (-0.14%); split: -0.69%, +0.55%
Branches: 100740 -> 100735 (-0.00%); split: -0.01%, +0.00%
PreVGPRs: 70119 -> 69968 (-0.22%)

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

---

 src/amd/compiler/aco_optimizer.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp
index 1fd3cf61941..2c346b976ba 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -948,6 +948,9 @@ parse_extract(Instruction* instr)
       unsigned offset = instr->operands[1].constantValue() * size;
       if (size <= 2)
          return SubdwordSel(size, offset, false);
+   } else if (instr->opcode == aco_opcode::p_split_vector) {
+      assert(instr->operands[0].bytes() == 4 && instr->definitions[1].bytes() == 2);
+      return SubdwordSel(2, 2, false);
    }
 
    return SubdwordSel();
@@ -1456,6 +1459,12 @@ label_instruction(opt_ctx& ctx, aco_ptr<Instruction>& instr)
          }
          break;
       } else if (!info.is_vec()) {
+         if (instr->operands[0].bytes() == 4 && instr->definitions.size() == 2) {
+            /* D16 subdword split */
+            ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
+            if (instr->definitions[1].bytes() == 2)
+               ctx.info[instr->definitions[1].tempId()].set_extract(instr.get());
+         }
          break;
       }
 



More information about the mesa-commit mailing list