From 930ca0e03862a86b4fe0933661e4220cf114bfb0 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Mon, 29 Jan 2018 15:33:55 -0500 Subject: [PATCH] freedreno/ir3: some more debug prints Signed-off-by: Rob Clark --- .../drivers/freedreno/ir3/ir3_compiler_nir.c | 5 +++ src/gallium/drivers/freedreno/ir3/ir3_print.c | 31 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c index 15a3aa4c802..23888770fbe 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c @@ -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) { diff --git a/src/gallium/drivers/freedreno/ir3/ir3_print.c b/src/gallium/drivers/freedreno/ir3/ir3_print.c index 8aebf21a1be..c399c69ea2a 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_print.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_print.c @@ -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); -- 2.30.2