pan/midgard: Print MIR by the bundle
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 30 Aug 2019 18:03:44 +0000 (11:03 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 30 Aug 2019 22:50:27 +0000 (15:50 -0700)
After scheduling, we still have valid MIR, but we have additional
bundling annotations which we would like to keep debug, so print these.

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

index 66b17be5bf6786825766310067d7104b953bdb09..50eb626f5e88b87f1d6d3477154d18a1940005e2 100644 (file)
@@ -176,8 +176,17 @@ mir_print_block(midgard_block *block)
 {
         printf("block%d: {\n", block->source_id);
 
-        mir_foreach_instr_in_block(block, ins) {
-                mir_print_instruction(ins);
+        if (block->is_scheduled) {
+                mir_foreach_bundle_in_block(block, bundle) {
+                        for (unsigned i = 0; i < bundle->instruction_count; ++i)
+                                mir_print_instruction(bundle->instructions[i]);
+
+                        printf("\n");
+                }
+        } else {
+                mir_foreach_instr_in_block(block, ins) {
+                        mir_print_instruction(ins);
+                }
         }
 
         printf("}");