From c759f90488233966a0fadd44f41e8daadbbd8da6 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Mon, 1 Sep 2014 17:34:03 -0400 Subject: [PATCH] ra: add some debug printfs Signed-off-by: Connor Abbott --- src/mesa/program/register_allocate.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mesa/program/register_allocate.c b/src/mesa/program/register_allocate.c index db2be5d..6439b78 100644 --- a/src/mesa/program/register_allocate.c +++ b/src/mesa/program/register_allocate.c @@ -454,6 +454,8 @@ ra_simplify(struct ra_graph *g) { bool progress = true; int i; + + printf("--- begin simplify ---\n"); while (progress) { unsigned int best_optimistic_node = ~0; @@ -464,8 +466,11 @@ ra_simplify(struct ra_graph *g) for (i = g->count - 1; i >= 0; i--) { if (g->nodes[i].in_stack || g->nodes[i].reg != NO_REG) continue; + + printf("got here with node %d\n", i); if (pq_test(g, i)) { + printf("pushing node %d onto the stack\n", i); decrement_q(g, i); g->stack[g->stack_count] = i; g->stack_count++; @@ -474,6 +479,7 @@ ra_simplify(struct ra_graph *g) } else { unsigned int new_q_total = g->nodes[i].q_total; if (new_q_total < lowest_q_total) { + printf("considering node %d for optimistic coloring\n", i); best_optimistic_node = i; lowest_q_total = new_q_total; } @@ -481,6 +487,7 @@ ra_simplify(struct ra_graph *g) } if (!progress && best_optimistic_node != ~0) { + printf("optimistically pushing node %u onto the stack\n", best_optimistic_node); decrement_q(g, best_optimistic_node); g->stack[g->stack_count] = best_optimistic_node; g->stack_count++; @@ -488,6 +495,8 @@ ra_simplify(struct ra_graph *g) progress = true; } } + + printf("--- end simplify ---\n"); } /** -- 1.8.5.2 (Apple Git-48)