summaryrefslogtreecommitdiffstats
path: root/src/broadcom
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-03-14 11:03:23 -0700
committerEric Anholt <[email protected]>2018-03-19 16:44:20 -0700
commit00910e3057588de3fe9b5dc2ae9263c2e4ba6cc4 (patch)
tree351a547518d1fc02b588d947408286ed87f244c3 /src/broadcom
parentfacc3c6f58de88ac3707a1b8435b7fc655d13124 (diff)
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.
Diffstat (limited to 'src/broadcom')
-rw-r--r--src/broadcom/compiler/v3d_compiler.h1
-rw-r--r--src/broadcom/compiler/vir.c3
-rw-r--r--src/broadcom/compiler/vir_dump.c4
-rw-r--r--src/broadcom/compiler/vir_live_variables.c2
4 files changed, 8 insertions, 2 deletions
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;
}