util/ra: Only update best_optimistic_node if !progress
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 9 May 2019 18:51:03 +0000 (13:51 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Tue, 14 May 2019 17:30:22 +0000 (12:30 -0500)
This shaves about half a second off the 30 second compile time of one of
the compute shaders in Aztec ruins.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/util/register_allocate.c

index 727c0c205fe67d8e7d897cfa8d40edf4d43943f9..9493f578dba6702751aad47c0f7bf256e7990f68 100644 (file)
@@ -524,7 +524,11 @@ ra_simplify(struct ra_graph *g)
             g->stack_count++;
             BITSET_SET(g->in_stack, i);
             progress = true;
-         } else {
+         } else if (!progress) {
+            /* We only need to do this if we haven't made progress.  If we
+             * have made progress, we'll throw the data away and loop again
+             * anyway.
+             */
             unsigned int new_q_total = g->nodes[i].q_total;
             if (new_q_total < lowest_q_total) {
                best_optimistic_node = i;