vc4: Print a reg pressure estimate in our reg allocation failure dump.
authorEric Anholt <eric@anholt.net>
Mon, 7 Nov 2016 18:16:45 +0000 (10:16 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 9 Nov 2016 23:33:56 +0000 (15:33 -0800)
src/gallium/drivers/vc4/vc4_qir.c

index 446af66affde8781df8243c907fa0b5ca7d4da1b..a34eccf5091d8ccf7963b09dffe8206d022b7fc6 100644 (file)
@@ -381,6 +381,7 @@ void
 qir_dump(struct vc4_compile *c)
 {
         int ip = 0;
+        int pressure = 0;
 
         qir_for_each_block(block, c) {
                 fprintf(stderr, "BLOCK %d:\n", block->index);
@@ -388,6 +389,8 @@ qir_dump(struct vc4_compile *c)
                         if (c->temp_start) {
                                 bool first = true;
 
+                                fprintf(stderr, "%3d ", pressure);
+
                                 for (int i = 0; i < c->num_temps; i++) {
                                         if (c->temp_start[i] != ip)
                                                 continue;
@@ -398,6 +401,7 @@ qir_dump(struct vc4_compile *c)
                                                 fprintf(stderr, ", ");
                                         }
                                         fprintf(stderr, "S%4d", i);
+                                        pressure++;
                                 }
 
                                 if (first)
@@ -419,6 +423,7 @@ qir_dump(struct vc4_compile *c)
                                                 fprintf(stderr, ", ");
                                         }
                                         fprintf(stderr, "E%4d", i);
+                                        pressure--;
                                 }
 
                                 if (first)