summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-05-09 13:51:03 -0500
committerJason Ekstrand <[email protected]>2019-05-14 12:30:22 -0500
commit9d6d1f47e784df5941412f1e7f8946c65cb55c8d (patch)
treee39d21b3013b0d32615ab9e04ca47be803a8ff69 /src
parentde56d3a2d1ce5ebd223c0e490d1884f976bddcb7 (diff)
util/ra: Only update best_optimistic_node if !progress
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/util/register_allocate.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util/register_allocate.c b/src/util/register_allocate.c
index 727c0c205fe..9493f578dba 100644
--- a/src/util/register_allocate.c
+++ b/src/util/register_allocate.c
@@ -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;