From: Eric Anholt Date: Wed, 14 Mar 2018 18:03:23 +0000 (-0700) Subject: broadcom/vc5: Don't annotate dumps with stale live intervals. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=00910e3057588de3fe9b5dc2ae9263c2e4ba6cc4;p=mesa.git broadcom/vc5: Don't annotate dumps with stale live intervals. As you're debugging register allocation, you may have changed the intervals and not recomputed yet. Just skip the dump in that case. --- diff --git a/src/broadcom/compiler/v3d_compiler.h b/src/broadcom/compiler/v3d_compiler.h index 84cc4d290a0..df81f0757e2 100644 --- a/src/broadcom/compiler/v3d_compiler.h +++ b/src/broadcom/compiler/v3d_compiler.h @@ -548,6 +548,7 @@ struct v3d_compile { /* Live ranges of temps. */ int *temp_start, *temp_end; + bool live_intervals_valid; uint32_t *uniform_data; enum quniform_contents *uniform_contents; diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c index 0cbdc986d3f..05f557fbcd0 100644 --- a/src/broadcom/compiler/vir.c +++ b/src/broadcom/compiler/vir.c @@ -435,6 +435,7 @@ vir_emit(struct v3d_compile *c, struct qinst *inst) } c->cursor = vir_after_inst(inst); + c->live_intervals_valid = false; } /* Updates inst to write to a new temporary, emits it, and notes the def. */ @@ -813,6 +814,8 @@ vir_remove_instruction(struct v3d_compile *c, struct qinst *qinst) list_del(&qinst->link); free(qinst); + + c->live_intervals_valid = false; } struct qreg diff --git a/src/broadcom/compiler/vir_dump.c b/src/broadcom/compiler/vir_dump.c index ef860cbb5c1..90a3fb0ac65 100644 --- a/src/broadcom/compiler/vir_dump.c +++ b/src/broadcom/compiler/vir_dump.c @@ -321,7 +321,7 @@ vir_dump(struct v3d_compile *c) vir_for_each_block(block, c) { fprintf(stderr, "BLOCK %d:\n", block->index); vir_for_each_inst(inst, block) { - if (c->temp_start) { + if (c->live_intervals_valid) { bool first = true; for (int i = 0; i < c->num_temps; i++) { @@ -342,7 +342,7 @@ vir_dump(struct v3d_compile *c) fprintf(stderr, " "); } - if (c->temp_end) { + if (c->live_intervals_valid) { bool first = true; for (int i = 0; i < c->num_temps; i++) { diff --git a/src/broadcom/compiler/vir_live_variables.c b/src/broadcom/compiler/vir_live_variables.c index 20acace1faf..019cde14567 100644 --- a/src/broadcom/compiler/vir_live_variables.c +++ b/src/broadcom/compiler/vir_live_variables.c @@ -347,4 +347,6 @@ vir_calculate_live_intervals(struct v3d_compile *c) ; vir_compute_start_end(c, c->num_temps); + + c->live_intervals_valid = true; }