aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/program
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/program')
-rw-r--r--mesalib/src/mesa/program/register_allocate.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mesalib/src/mesa/program/register_allocate.c b/mesalib/src/mesa/program/register_allocate.c
index 97d4e331c..88793dbdc 100644
--- a/mesalib/src/mesa/program/register_allocate.c
+++ b/mesalib/src/mesa/program/register_allocate.c
@@ -555,6 +555,13 @@ ra_get_best_spill_node(struct ra_graph *g)
if (cost <= 0.0)
continue;
+ /* Only consider registers for spilling if they are still in the
+ * interference graph (those on the stack have already been proven to be
+ * allocatable without spilling).
+ */
+ if (g->nodes[n].in_stack)
+ continue;
+
benefit = ra_get_spill_benefit(g, n);
if (benefit / cost > best_benefit) {