Mesa (master): vc4: Add better debug for register allocation failure.

Eric Anholt anholt at kemper.freedesktop.org
Tue Jul 14 18:40:19 UTC 2015


Module: Mesa
Branch: master
Commit: 1e80c9fab98d7de216937a47f8e231f3beb78403
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1e80c9fab98d7de216937a47f8e231f3beb78403

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Jul 10 17:01:37 2015 -0700

vc4: Add better debug for register allocation failure.

---

 src/gallium/drivers/vc4/vc4_register_allocate.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/vc4/vc4_register_allocate.c b/src/gallium/drivers/vc4/vc4_register_allocate.c
index 3b0b890..73964b4 100644
--- a/src/gallium/drivers/vc4/vc4_register_allocate.c
+++ b/src/gallium/drivers/vc4/vc4_register_allocate.c
@@ -270,7 +270,11 @@ vc4_register_allocate(struct vc4_context *vc4, struct vc4_compile *c)
         }
 
         bool ok = ra_allocate(g);
-        assert(ok);
+        if (!ok) {
+                fprintf(stderr, "Failed to register allocate:\n");
+                qir_dump(c);
+                abort();
+        }
 
         for (uint32_t i = 0; i < c->num_temps; i++) {
                 temp_registers[i] = vc4_regs[ra_get_node_reg(g, temp_to_node[i])];




More information about the mesa-commit mailing list