summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_qir.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2016-07-06 12:49:52 -0700
committerEric Anholt <[email protected]>2016-07-12 17:42:37 -0700
commit6d343450014e86e22f1d067d79c6fff524d4c8d1 (patch)
tree0eb9fcc54335b6fd1d003cd2afe5707ba130b405 /src/gallium/drivers/vc4/vc4_qir.c
parent89918c1e74e454af119e7ae23f3ed66fc26abc4b (diff)
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.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_qir.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_qir.c45
1 files changed, 45 insertions, 0 deletions
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++;
}
}
}