aco: Abort when RA can't find a register.
authorTimur Kristóf <timur.kristof@gmail.com>
Mon, 10 Feb 2020 15:34:56 +0000 (16:34 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 24 Apr 2020 17:58:57 +0000 (17:58 +0000)
Previously, it was just unreachable, which means it will generate
invalid shaders when it encounters a situation when it can't allocate
registers for eg. a large load.

This commit makes it slightly easier to notice such problems without
triggering a GPU hang.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4536>

src/amd/compiler/aco_register_allocation.cpp

index 44fb2907cdddc36afb43b9eb19bf6cc9b8da88a8..03c0c334cdf440df0dee57eb4053ce13917da429 100644 (file)
@@ -988,7 +988,8 @@ PhysReg get_reg(ra_ctx& ctx,
 
    //FIXME: if nothing helps, shift-rotate the registers to make space
 
-   unreachable("did not find a register");
+   fprintf(stderr, "ACO: failed to allocate registers during shader compilation\n");
+   abort();
 }
 
 PhysReg get_reg_create_vector(ra_ctx& ctx,