Mesa (master): v3d: Include a count of register pressure in the RA failure dumps.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Mar 6 22:14:25 UTC 2019


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

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Feb 21 12:47:37 2019 -0800

v3d: Include a count of register pressure in the RA failure dumps.

You usually want to go find the highest pressure and figure out why you
couldn't spill or what pattern led to a bunch of pressure leading to that
point.

---

 src/broadcom/compiler/vir_dump.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/broadcom/compiler/vir_dump.c b/src/broadcom/compiler/vir_dump.c
index 7f58c59a31b..8fd32931c1b 100644
--- a/src/broadcom/compiler/vir_dump.c
+++ b/src/broadcom/compiler/vir_dump.c
@@ -348,11 +348,19 @@ void
 vir_dump(struct v3d_compile *c)
 {
         int ip = 0;
+        int pressure = 0;
 
         vir_for_each_block(block, c) {
                 fprintf(stderr, "BLOCK %d:\n", block->index);
                 vir_for_each_inst(inst, block) {
                         if (c->live_intervals_valid) {
+                                for (int i = 0; i < c->num_temps; i++) {
+                                        if (c->temp_start[i] == ip)
+                                                pressure++;
+                                }
+
+                                fprintf(stderr, "P%4d ", pressure);
+
                                 bool first = true;
 
                                 for (int i = 0; i < c->num_temps; i++) {
@@ -364,7 +372,10 @@ vir_dump(struct v3d_compile *c)
                                         } else {
                                                 fprintf(stderr, ", ");
                                         }
-                                        fprintf(stderr, "S%4d", i);
+                                        if (BITSET_TEST(c->spillable, i))
+                                                fprintf(stderr, "S%4d", i);
+                                        else
+                                                fprintf(stderr, "U%4d", i);
                                 }
 
                                 if (first)
@@ -386,6 +397,7 @@ vir_dump(struct v3d_compile *c)
                                                 fprintf(stderr, ", ");
                                         }
                                         fprintf(stderr, "E%4d", i);
+                                        pressure--;
                                 }
 
                                 if (first)




More information about the mesa-commit mailing list