pan/bi: Allow printing branches without targets
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 27 May 2020 22:09:44 +0000 (18:09 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 29 May 2020 20:34:55 +0000 (20:34 +0000)
Useful for debugging codegen.

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

src/panfrost/bifrost/bi_print.c

index 7a3d429767b7c0e4da675a75b2bf7b8bacaa0942..681075c6c7eb7b3e560a3363ce3372b3aa06512d 100644 (file)
@@ -402,8 +402,11 @@ bi_print_instruction(bi_instruction *ins, FILE *fp)
         }
 
         if (ins->type == BI_BRANCH) {
-                assert(ins->branch_target);
-                fprintf(fp, "-> block%u", ins->branch_target->base.name);
+                if (ins->branch_target) {
+                        fprintf(fp, "-> block%u", ins->branch_target->base.name);
+                } else {
+                        fprintf(fp, "-> void");
+                }
         } else if (ins->type == BI_TEX) {
                 bi_print_texture(&ins->texture, fp);
         }