Mesa (staging/20.3): panfrost/lcra: Fix constraint counting

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 11 22:01:33 UTC 2021


Module: Mesa
Branch: staging/20.3
Commit: 0602af57bc4678087d446a659f9a789e4f42bb55
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0602af57bc4678087d446a659f9a789e4f42bb55

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Mon Mar  1 16:01:22 2021 +0000

panfrost/lcra: Fix constraint counting

We need to iterate the whole row, we can't be clever and only look at
one side, the symmetry doesn't work like that. See the original paper.

total instructions in shared programs: 69392 -> 69322 (-0.10%)
instructions in affected programs: 9002 -> 8932 (-0.78%)
helped: 82
HURT: 28
Instructions are helped.

total bundles in shared programs: 32225 -> 32155 (-0.22%)
bundles in affected programs: 4286 -> 4216 (-1.63%)
helped: 82
HURT: 28
Bundles are helped.

total quadwords in shared programs: 56102 -> 56102 (0.00%)
quadwords in affected programs: 0 -> 0
helped: 0
HURT: 0

total registers in shared programs: 4552 -> 4572 (0.44%)
registers in affected programs: 298 -> 318 (6.71%)
helped: 18
HURT: 38
Registers are HURT.

total threads in shared programs: 3772 -> 3775 (0.08%)
threads in affected programs: 84 -> 87 (3.57%)
helped: 15
HURT: 14
Inconclusive result (value mean confidence interval includes 0).

total spills in shared programs: 0 -> 0
spills in affected programs: 0 -> 0
helped: 0
HURT: 0

total fills in shared programs: 0 -> 0
fills in affected programs: 0 -> 0
helped: 0
HURT: 0

Fixes: 66ad64d73d2 ("pan/midgard: Implement linearly-constrained register allocation")
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9338>
(cherry picked from commit 4f969d796d6f8dbd3bc96d518d5f6d268b4a2d56)

---

 .pick_status.json        | 2 +-
 src/panfrost/util/lcra.c | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 40b2daa3810..9202b938d5a 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -3541,7 +3541,7 @@
         "description": "panfrost/lcra: Fix constraint counting",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "66ad64d73d244501f5c70c742564cb5ab4fb56da"
     },
diff --git a/src/panfrost/util/lcra.c b/src/panfrost/util/lcra.c
index d922972b619..9b938abf9d3 100644
--- a/src/panfrost/util/lcra.c
+++ b/src/panfrost/util/lcra.c
@@ -207,15 +207,13 @@ lcra_set_node_spill_cost(struct lcra_state *l, unsigned node, signed cost)
                 l->spill_cost[node] = cost;
 }
 
-/* Count along the lower triangle */
-
 static unsigned
 lcra_count_constraints(struct lcra_state *l, unsigned i)
 {
         unsigned count = 0;
         unsigned *constraints = &l->linear[i * l->node_count];
 
-        for (unsigned j = 0; j < i; ++j)
+        for (unsigned j = 0; j < l->node_count; ++j)
                 count += util_bitcount(constraints[j]);
 
         return count;



More information about the mesa-commit mailing list