util/ra: Only update q_total if the reg is not assigned
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 9 May 2019 22:05:31 +0000 (17:05 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Tue, 14 May 2019 17:30:22 +0000 (12:30 -0500)
We only use q_total if the reg is not assigned so there's no point in
updating it if the reg is not assigned.  This has no known perf benefit
but it will reduce churn in a future commit.

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

index 9493f578dba6702751aad47c0f7bf256e7990f68..0c62ad3865cdc3e27a2c404087b29f02d13b80a9 100644 (file)
@@ -484,7 +484,7 @@ decrement_q(struct ra_graph *g, unsigned int n)
       unsigned int n2 = g->nodes[n].adjacency_list[i];
       unsigned int n2_class = g->nodes[n2].class;
 
-      if (!BITSET_TEST(g->in_stack, n2)) {
+      if (!BITSET_TEST(g->in_stack, n2) && g->nodes[n2].reg == NO_REG) {
          assert(g->nodes[n2].q_total >= g->regs->classes[n2_class]->q[n_class]);
          g->nodes[n2].q_total -= g->regs->classes[n2_class]->q[n_class];
       }