From cce1a2fc196e917be5de07d20d48f300b053195c Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 24 Jul 2021 14:54:34 -0400 Subject: [PATCH] agx: Dump register file when failing to allocate Usually shows a bug. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_register_allocate.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/asahi/compiler/agx_register_allocate.c b/src/asahi/compiler/agx_register_allocate.c index 1d347aca081..b5e9000984f 100644 --- a/src/asahi/compiler/agx_register_allocate.c +++ b/src/asahi/compiler/agx_register_allocate.c @@ -89,6 +89,14 @@ agx_assign_regs(BITSET_WORD *used_regs, unsigned count, unsigned align, unsigned } } + /* Couldn't find a free register, dump the state of the register file */ + fprintf(stderr, "Failed to find register of size %u aligned %u max %u.\n", + count, align, max); + + fprintf(stderr, "Register file:\n"); + for (unsigned i = 0; i < BITSET_WORDS(max); ++i) + fprintf(stderr, " %08X\n", used_regs[i]); + unreachable("Could not find a free register"); }