diff --git a/src/panfrost/bifrost/bi_printer.c.py b/src/panfrost/bifrost/bi_printer.c.py index 7016d385dc6..f61e1996e43 100644 --- a/src/panfrost/bifrost/bi_printer.c.py +++ b/src/panfrost/bifrost/bi_printer.c.py @@ -75,6 +75,9 @@ bir_passthrough_name(unsigned idx) static void bi_print_index(FILE *fp, bi_index index) { + if (index.discard) + fputs("`", fp); + if (bi_is_null(index)) fprintf(fp, "_"); else if (index.type == BI_INDEX_CONSTANT) diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 8ee2cb17df4..12e89e3fdc2 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -83,6 +83,10 @@ typedef struct { bool abs : 1; bool neg : 1; + /* The last use of a value, should be purged from the register cache. + * Set by liveness analysis. */ + bool discard : 1; + /* For a source, the swizzle. For a destination, acts a bit like a * write mask. Identity for the full 32-bit, H00 for only caring about * the lower half, other values unused. */ @@ -207,6 +211,13 @@ bi_neg(bi_index idx) return idx; } +static inline bi_index +bi_discard(bi_index idx) +{ + idx.discard = true; + return idx; +} + /* Additive identity in IEEE 754 arithmetic */ static inline bi_index bi_negzero()