Mesa (master): aco: fix def-use distance calculation when scheduling.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 22 14:47:50 UTC 2020


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

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Thu Aug 13 10:13:49 2020 +0200

aco: fix def-use distance calculation when scheduling.

This change also increases the VMEM_MAX_MOVES
to mitigate some of the scheduling changes.

Totals from 34301 (24.61% of 139391) affected shaders:
SGPRs: 2515440 -> 2552304 (+1.47%); split: -1.25%, +2.71%
VGPRs: 1786676 -> 1794724 (+0.45%); split: -0.31%, +0.76%
CodeSize: 151079856 -> 151209828 (+0.09%); split: -0.06%, +0.15%
MaxWaves: 392454 -> 388966 (-0.89%); split: +0.39%, -1.28%
Instrs: 28870746 -> 28895907 (+0.09%); split: -0.09%, +0.17%
Cycles: 960450680 -> 961315796 (+0.09%); split: -0.09%, +0.18%
VMEM: 19027987 -> 19796223 (+4.04%); split: +7.49%, -3.45%
SMEM: 2434691 -> 2394829 (-1.64%); split: +2.80%, -4.43%
VClause: 551776 -> 543051 (-1.58%); split: -1.73%, +0.15%
SClause: 1230147 -> 1227637 (-0.20%); split: -1.40%, +1.20%
Copies: 1957640 -> 1963617 (+0.31%); split: -1.11%, +1.41%
Branches: 611747 -> 612504 (+0.12%); split: -0.11%, +0.23%

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

---

 src/amd/compiler/aco_scheduler.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/amd/compiler/aco_scheduler.cpp b/src/amd/compiler/aco_scheduler.cpp
index d7e7f1edabd..18b28d4499a 100644
--- a/src/amd/compiler/aco_scheduler.cpp
+++ b/src/amd/compiler/aco_scheduler.cpp
@@ -33,7 +33,7 @@
 #define VMEM_WINDOW_SIZE (1024 - ctx.num_waves * 64)
 #define POS_EXP_WINDOW_SIZE 512
 #define SMEM_MAX_MOVES (64 - ctx.num_waves * 4)
-#define VMEM_MAX_MOVES (128 - ctx.num_waves * 8)
+#define VMEM_MAX_MOVES (256 - ctx.num_waves * 16)
 /* creating clauses decreases def-use distances, so make it less aggressive the lower num_waves is */
 #define VMEM_CLAUSE_MAX_GRAB_DIST ((ctx.num_waves - 1) * 8)
 #define POS_EXP_MAX_MOVES 512
@@ -733,7 +733,8 @@ void schedule_VMEM(sched_ctx& ctx, Block* block,
       }
       if (part_of_clause)
          add_to_hazard_query(&indep_hq, candidate_ptr);
-      k++;
+      else
+         k++;
       if (candidate_idx < ctx.last_SMEM_dep_idx)
          ctx.last_SMEM_stall++;
    }
@@ -782,6 +783,8 @@ void schedule_VMEM(sched_ctx& ctx, Block* block,
       if (is_dependency || !found_dependency) {
          if (found_dependency)
             add_to_hazard_query(&indep_hq, candidate.get());
+         else
+            k++;
          ctx.mv.upwards_skip();
          continue;
       }



More information about the mesa-commit mailing list