Lines Matching refs:nodes

34  * edges in the graph between nodes that interfere (can't be allocated
41 * That likely causes other nodes to become trivially colorable as well.
43 * Then during the "select" process, nodes are popped off of that
123 * it allocates the nodes.
479 BITSET_SET(g->nodes[n1].adjacency, n2);
483 int n1_class = g->nodes[n1].class;
484 int n2_class = g->nodes[n2].class;
485 g->nodes[n1].q_total += g->regs->classes[n1_class]->q[n2_class];
487 util_dynarray_append(&g->nodes[n1].adjacency_list, unsigned int, n2);
493 BITSET_CLEAR(g->nodes[n1].adjacency, n2);
497 int n1_class = g->nodes[n1].class;
498 int n2_class = g->nodes[n2].class;
499 g->nodes[n1].q_total -= g->regs->classes[n1_class]->q[n2_class];
501 util_dynarray_delete_unordered(&g->nodes[n1].adjacency_list, unsigned int,
517 g->nodes = reralloc(g, g->nodes, struct ra_node, alloc);
521 /* For nodes already in the graph, we just have to grow the adjacency set */
523 assert(g->nodes[i].adjacency != NULL);
524 g->nodes[i].adjacency = rerzalloc(g, g->nodes[i].adjacency, BITSET_WORD,
528 /* For new nodes, we have to fully initialize them */
530 memset(&g->nodes[i], 0, sizeof(g->nodes[i]));
531 g->nodes[i].adjacency = rzalloc_array(g, BITSET_WORD, bitset_count);
532 util_dynarray_init(&g->nodes[i].adjacency_list, g);
533 g->nodes[i].q_total = 0;
535 g->nodes[i].forced_reg = NO_REG;
536 g->nodes[i].reg = NO_REG;
589 g->nodes[n].class = class->index;
596 return g->regs->classes[g->nodes[n].class];
615 if (n1 != n2 && !BITSET_TEST(g->nodes[n1].adjacency, n2)) {
624 util_dynarray_foreach(&g->nodes[n].adjacency_list, unsigned int, n2p) {
628 memset(g->nodes[n].adjacency, 0,
630 util_dynarray_clear(&g->nodes[n].adjacency_list);
637 int n_class = g->nodes[n].class;
638 if (g->nodes[n].tmp.q_total < g->regs->classes[n_class]->p) {
647 if (g->nodes[n].tmp.q_total < g->tmp.min_q_total[i] ||
648 (g->nodes[n].tmp.q_total == g->tmp.min_q_total[i] &&
650 g->tmp.min_q_total[i] = g->nodes[n].tmp.q_total;
659 int n_class = g->nodes[n].class;
663 util_dynarray_foreach(&g->nodes[n].adjacency_list, unsigned int, n2p) {
665 unsigned int n2_class = g->nodes[n2].class;
669 assert(g->nodes[n2].tmp.q_total >= g->regs->classes[n2_class]->q[n_class]);
670 g->nodes[n2].tmp.q_total -= g->regs->classes[n2_class]->q[n_class];
685 * trivially-colorable nodes into a stack of nodes to be colored,
688 * If we encounter a case where we can't push any nodes on the stack, then
715 g->nodes[n].reg = g->nodes[n].forced_reg;
716 g->nodes[n].tmp.q_total = g->nodes[n].q_total;
717 if (g->nodes[n].reg != NO_REG)
760 * one of these nodes to the stack. It needs to be
769 if (g->nodes[n].tmp.q_total < g->tmp.min_q_total[i]) {
770 g->tmp.min_q_total[i] = g->nodes[n].tmp.q_total;
812 util_dynarray_foreach(&g->nodes[n].adjacency_list, unsigned int, n2p) {
817 ra_class_allocations_conflict(g->regs->classes[g->nodes[n].class], r,
818 g->regs->classes[g->nodes[n2].class], g->nodes[n2].reg)) {
819 return &g->nodes[n2];
835 struct ra_class *c = g->regs->classes[g->nodes[n].class];
840 /* Remove any regs that conflict with nodes that we're adjacent to and have
843 util_dynarray_foreach(&g->nodes[n].adjacency_list, unsigned int, n2p) {
844 struct ra_node *n2 = &g->nodes[*n2p];
869 * Pops nodes from the stack back into the graph, coloring them with
872 * If all nodes were trivially colorable, then this must succeed. If
888 struct ra_class *c = g->regs->classes[g->nodes[n].class];
933 g->nodes[n].reg = r;
936 /* Rotate the starting point except for any nodes above the lowest
938 * at allocating optimistically colorable nodes is highly dependent on
939 * the way that the previous nodes popped off the stack are laid out.
941 * file and decreases the number of nearby nodes assigned to the same
965 if (g->nodes[n].forced_reg != NO_REG)
966 return g->nodes[n].forced_reg;
968 return g->nodes[n].reg;
976 * input data). These nodes do not end up in the stack during
987 g->nodes[n].forced_reg = reg;
994 int n_class = g->nodes[n].class;
1001 util_dynarray_foreach(&g->nodes[n].adjacency_list, unsigned int, n2p) {
1003 unsigned int n2_class = g->nodes[n2].class;
1013 * the pq test, or -1 if there are no spillable nodes.
1022 /* Consider any nodes that we colored successfully or the node we failed to
1024 * only considered these nodes, so spilling any other ones would not result
1028 float cost = g->nodes[n].spill_cost;
1049 * Only nodes with a spill cost set (cost != 0.0) will be considered
1055 g->nodes[n].spill_cost = cost;