pan/midgard; Dump successor graph when printing MIR
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 19 Jul 2019 21:21:35 +0000 (14:21 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 22 Jul 2019 15:20:34 +0000 (08:20 -0700)
We just use the pointers of the midgard_block*, which is crude, but it
gets the point across and will help debug successor related issues.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/midgard_print.c

index 6e10429cceea788daabaf764bae642bca1cbacee..a950c13c93d28b9ea5418ab4b52e7a1b6b853d59 100644 (file)
@@ -106,13 +106,23 @@ mir_print_instruction(midgard_instruction *ins)
 void
 mir_print_block(midgard_block *block)
 {
-        printf("{\n");
+        printf("%p: {\n", block);
 
         mir_foreach_instr_in_block(block, ins) {
                 mir_print_instruction(ins);
         }
 
-        printf("}\n");
+        printf("}");
+
+        if (block->nr_successors) {
+                printf(" -> ");
+                for (unsigned i = 0; i < block->nr_successors; ++i) {
+                        printf("%p%s", block->successors[i],
+                                        (i + 1) != block->nr_successors ? ", " : "");
+                }
+        }
+
+        printf("\n\n");
 }
 
 void