Mesa (staging/21.0): aco: allow SGPRs on every src position for VOP3P

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 13 19:31:06 UTC 2021


Module: Mesa
Branch: staging/21.0
Commit: 03196956456a06d4fe91224615926ed81dacb159
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=03196956456a06d4fe91224615926ed81dacb159

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Fri Jan  8 23:14:16 2021 +0100

aco: allow SGPRs on every src position for VOP3P

Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6680>
(cherry picked from commit 178b33c87089ddec0df1e7adac9bf4630974439f)

---

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

diff --git a/.pick_status.json b/.pick_status.json
index 8d587520d01..627e4fc76f9 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -373,7 +373,7 @@
         "description": "aco: allow SGPRs on every src position for VOP3P",
         "nominated": false,
         "nomination_type": null,
-        "resolution": 4,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp
index deebff042f4..c986c6f69e7 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -2524,7 +2524,8 @@ void apply_sgprs(opt_ctx &ctx, aco_ptr<Instruction>& instr)
       /* Applying two sgprs require making it VOP3, so don't do it unless it's
        * definitively beneficial.
        * TODO: this is too conservative because later the use count could be reduced to 1 */
-      if (num_sgprs && ctx.uses[sgpr_info_id] > 1 && !instr->isVOP3() && !instr->isSDWA())
+      if (num_sgprs && ctx.uses[sgpr_info_id] > 1 &&
+          !instr->isVOP3() && !instr->isSDWA() && instr->format != Format::VOP3P)
          break;
 
       Temp sgpr = ctx.info[sgpr_info_id].temp;
@@ -2532,7 +2533,8 @@ void apply_sgprs(opt_ctx &ctx, aco_ptr<Instruction>& instr)
       if (new_sgpr && num_sgprs >= max_sgprs)
          continue;
 
-      if (sgpr_idx == 0 || instr->isVOP3() || instr->isSDWA()) {
+      if (sgpr_idx == 0 || instr->isVOP3() ||
+          instr->isSDWA() || instr->format == Format::VOP3P) {
          instr->operands[sgpr_idx] = Operand(sgpr);
       } else if (can_swap_operands(instr)) {
          instr->operands[sgpr_idx] = instr->operands[0];



More information about the mesa-commit mailing list