Mesa (master): vc4: Put dead writes into the NOP register when generating code.
Eric Anholt
anholt at kemper.freedesktop.org
Tue Sep 23 21:52:58 UTC 2014
Module: Mesa
Branch: master
Commit: 9dbfca10a306fe5ae5b81845cb8f4d16022d6790
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9dbfca10a306fe5ae5b81845cb8f4d16022d6790
Author: Eric Anholt <eric at anholt.net>
Date: Tue Sep 23 13:20:29 2014 -0700
vc4: Put dead writes into the NOP register when generating code.
They still provide register pressure since I haven't made a special class
for them, but since they're only live for one instruction it probably
doesn't matter.
This improves the readability of QPU assembly.
---
src/gallium/drivers/vc4/vc4_register_allocate.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/vc4/vc4_register_allocate.c b/src/gallium/drivers/vc4/vc4_register_allocate.c
index 639037e..72f5271 100644
--- a/src/gallium/drivers/vc4/vc4_register_allocate.c
+++ b/src/gallium/drivers/vc4/vc4_register_allocate.c
@@ -237,9 +237,16 @@ vc4_register_allocate(struct vc4_context *vc4, struct vc4_compile *c)
bool ok = ra_allocate(g);
assert(ok);
- for (uint32_t i = 0; i < c->num_temps; i++)
+ for (uint32_t i = 0; i < c->num_temps; i++) {
temp_registers[i] = vc4_regs[ra_get_node_reg(g, i)];
+ /* If the value's never used, just write to the NOP register
+ * for clarity in debug output.
+ */
+ if (def[i] == use[i])
+ temp_registers[i] = qpu_ra(QPU_W_NOP);
+ }
+
ralloc_free(g);
return temp_registers;
More information about the mesa-commit
mailing list