From: Eric Anholt Date: Wed, 6 Jul 2016 19:49:52 +0000 (-0700) Subject: vc4: Print live variable start/ends during QIR dumping. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6d343450014e86e22f1d067d79c6fff524d4c8d1;p=mesa.git vc4: Print live variable start/ends during QIR dumping. This only happens when live variables are set up, which is not in the normal dump, but is set up when we've failed to register allocate. --- diff --git a/src/gallium/drivers/vc4/vc4_qir.c b/src/gallium/drivers/vc4/vc4_qir.c index 3f59fceede9..4c81b567927 100644 --- a/src/gallium/drivers/vc4/vc4_qir.c +++ b/src/gallium/drivers/vc4/vc4_qir.c @@ -361,11 +361,56 @@ qir_dump_inst(struct vc4_compile *c, struct qinst *inst) void qir_dump(struct vc4_compile *c) { + int ip = 0; + qir_for_each_block(block, c) { fprintf(stderr, "BLOCK %d:\n", block->index); qir_for_each_inst(inst, block) { + if (c->temp_start) { + bool first = true; + + for (int i = 0; i < c->num_temps; i++) { + if (c->temp_start[i] != ip) + continue; + + if (first) { + first = false; + } else { + fprintf(stderr, ", "); + } + fprintf(stderr, "S%4d", i); + } + + if (first) + fprintf(stderr, " "); + else + fprintf(stderr, " "); + } + + if (c->temp_end) { + bool first = true; + + for (int i = 0; i < c->num_temps; i++) { + if (c->temp_end[i] != ip) + continue; + + if (first) { + first = false; + } else { + fprintf(stderr, ", "); + } + fprintf(stderr, "E%4d", i); + } + + if (first) + fprintf(stderr, " "); + else + fprintf(stderr, " "); + } + qir_dump_inst(c, inst); fprintf(stderr, "\n"); + ip++; } } }