pco/ra: abort if spilling fails

In release builds, the assertion checking whether spilling failed isn't
evaluated, which can result in shader compilation continuing despite this.

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Reviewed-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37872>
This commit is contained in:
Simon Perretta 2025-10-14 16:37:28 +01:00 committed by Marge Bot
parent 681c734804
commit 7b222d532b

View file

@ -28,6 +28,8 @@
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
/** Live range of an SSA variable. */
struct live_range {
@ -811,7 +813,10 @@ static bool pco_ra_func(pco_func *func, pco_ra_ctx *ctx)
ra_set_node_spill_cost(ra_graph, u, (float)uses[u]);
unsigned spill_index = ra_get_best_spill_node(ra_graph);
assert(spill_index != ~0 && "Failed to get best spill node.");
if (spill_index == ~0) {
fprintf(stderr, "FATAL: Failed to get best spill node.\n");
abort();
}
spill(spill_index, func, ctx);