freedreno/ir3: some more debug prints
authorRob Clark <robdclark@gmail.com>
Mon, 29 Jan 2018 20:33:55 +0000 (15:33 -0500)
committerRob Clark <robdclark@gmail.com>
Sat, 10 Feb 2018 19:54:58 +0000 (14:54 -0500)
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
src/gallium/drivers/freedreno/ir3/ir3_print.c

index 15a3aa4c8026cef07110a2d9244de132296340c4..23888770fbe4208d2f9bf9f8cd455b58390e4cb9 100644 (file)
@@ -3352,6 +3352,11 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler,
         */
        ir3_group(ir);
 
+       if (fd_mesa_debug & FD_DBG_OPTMSGS) {
+               printf("AFTER GROUPING:\n");
+               ir3_print(ir);
+       }
+
        ir3_depth(ir);
 
        if (fd_mesa_debug & FD_DBG_OPTMSGS) {
index 8aebf21a1be250ce2d74a0d38cbb5d64c3b4eebb..c399c69ea2a3b5c11f1e1ef0c313accb4ca5370a 100644 (file)
@@ -41,6 +41,7 @@ static void print_instr_name(struct ir3_instruction *instr)
        printf("%04u:", instr->serialno);
 #endif
        printf("%04u:", instr->name);
+       printf("%04u:", instr->ip);
        printf("%03u: ", instr->depth);
 
        if (instr->flags & IR3_INSTR_SY)
@@ -196,6 +197,17 @@ print_instr(struct ir3_instruction *instr, int lvl)
                printf(", target=block%u", block_id(instr->cat0.target));
        }
 
+       if (instr->deps_count) {
+               printf(", false-deps:");
+               for (unsigned i = 0; i < instr->deps_count; i++) {
+                       if (i > 0)
+                               printf(", ");
+                       printf("_[");
+                       print_instr_name(instr->deps[i]);
+                       printf("]");
+               }
+       }
+
        printf("\n");
 }
 
@@ -208,9 +220,28 @@ static void
 print_block(struct ir3_block *block, int lvl)
 {
        tab(lvl); printf("block%u {\n", block_id(block));
+
+       if (block->predecessors_count > 0) {
+               tab(lvl+1);
+               printf("pred: ");
+               for (unsigned i = 0; i < block->predecessors_count; i++) {
+                       if (i)
+                               printf(", ");
+                       printf("block%u", block_id(block->predecessors[i]));
+               }
+               printf("\n");
+       }
+
        list_for_each_entry (struct ir3_instruction, instr, &block->instr_list, node) {
                print_instr(instr, lvl+1);
        }
+
+       tab(lvl+1); printf("/* keeps:\n");
+       for (unsigned i = 0; i < block->keeps_count; i++) {
+               print_instr(block->keeps[i], lvl+2);
+       }
+       tab(lvl+1); printf(" */\n");
+
        if (block->successors[1]) {
                /* leading into if/else: */
                tab(lvl+1);