pan/bi: Improve block printing
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 5 Mar 2020 15:28:13 +0000 (10:28 -0500)
committerMarge Bot <eric+marge@anholt.net>
Sat, 7 Mar 2020 00:37:39 +0000 (00:37 +0000)
Skip predecessor printing if there are none and match a missing brace,
also fixup the spacing.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4097>

src/panfrost/bifrost/bi_print.c

index 029b11d6e470603fed771ac1fdc10b77d10bdf45..81b0f4aa0fce3f8680546c07e97fd10a2ccbe38c 100644 (file)
@@ -399,21 +399,25 @@ bi_print_block(bi_block *block, FILE *fp)
                         bi_print_instruction(ins, fp);
         }
 
+        fprintf(fp, "}");
+
         if (block->successors[0]) {
                 fprintf(fp, " -> ");
 
                 for (unsigned i = 0; i < ARRAY_SIZE(block->successors); ++i) {
                         if (block->successors[i])
-                                fprintf(fp, "block%u", block->successors[i]->name);
+                                fprintf(fp, "block%u ", block->successors[i]->name);
                 }
         }
 
-        fprintf(fp, " from ");
+        if (block->predecessors->entries) {
+                fprintf(fp, " from");
 
-        bi_foreach_predecessor(block, pred)
-                fprintf(fp, "block%u ", pred->name);
+                bi_foreach_predecessor(block, pred)
+                        fprintf(fp, " block%u", pred->name);
+        }
 
-        fprintf(fp, "\n");
+        fprintf(fp, "\n\n");
 }
 
 void