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
126 * List of which nodes this node interferes with. This should be
150 * interfering nodes not in the stack.
165 struct ra_node *nodes;
166 unsigned int count; /**< count of nodes. */
226 * it allocates the nodes.
396 BITSET_SET(g->nodes[n1].adjacency, n2);
400 int n1_class = g->nodes[n1].class;
401 int n2_class = g->nodes[n2].class;
402 g->nodes[n1].q_total += g->regs->classes[n1_class]->q[n2_class];
404 if (g->nodes[n1].adjacency_count >=
405 g->nodes[n1].adjacency_list_size) {
406 g->nodes[n1].adjacency_list_size *= 2;
407 g->nodes[n1].adjacency_list = reralloc(g, g->nodes[n1].adjacency_list,
409 g->nodes[n1].adjacency_list_size);
412 g->nodes[n1].adjacency_list[g->nodes[n1].adjacency_count] = n2;
413 g->nodes[n1].adjacency_count++;
424 g->nodes = rzalloc_array(g, struct ra_node, count);
431 g->nodes[i].adjacency = rzalloc_array(g, BITSET_WORD, bitset_count);
433 g->nodes[i].adjacency_list_size = 4;
434 g->nodes[i].adjacency_list =
435 ralloc_array(g, unsigned int, g->nodes[i].adjacency_list_size);
436 g->nodes[i].adjacency_count = 0;
437 g->nodes[i].q_total = 0;
439 g->nodes[i].reg = NO_REG;
459 g->nodes[n].class = class;
466 if (n1 != n2 && !BITSET_TEST(g->nodes[n1].adjacency, n2)) {
475 int n_class = g->nodes[n].class;
477 return g->nodes[n].q_total < g->regs->classes[n_class]->p;
484 int n_class = g->nodes[n].class;
486 for (i = 0; i < g->nodes[n].adjacency_count; i++) {
487 unsigned int n2 = g->nodes[n].adjacency_list[i];
488 unsigned int n2_class = g->nodes[n2].class;
490 if (!g->nodes[n2].in_stack) {
491 assert(g->nodes[n2].q_total >= g->regs->classes[n2_class]->q[n_class]);
492 g->nodes[n2].q_total -= g->regs->classes[n2_class]->q[n_class];
499 * trivially-colorable nodes into a stack of nodes to be colored,
502 * If we encounter a case where we can't push any nodes on the stack, then
521 if (g->nodes[i].in_stack || g->nodes[i].reg != NO_REG)
528 g->nodes[i].in_stack = true;
531 unsigned int new_q_total = g->nodes[i].q_total;
546 g->nodes[best_optimistic_node].in_stack = true;
559 for (i = 0; i < g->nodes[n].adjacency_count; i++) {
560 unsigned int n2 = g->nodes[n].adjacency_list[i];
562 if (!g->nodes[n2].in_stack &&
563 BITSET_TEST(g->regs->regs[r].conflicts, g->nodes[n2].reg)) {
580 struct ra_class *c = g->regs->classes[g->nodes[n].class];
585 /* Remove any regs that conflict with nodes that we're adjacent to and have
588 for (int i = 0; i < g->nodes[n].adjacency_count; i++) {
589 unsigned int n2 = g->nodes[n].adjacency_list[i];
590 unsigned int r = g->nodes[n2].reg;
592 if (!g->nodes[n2].in_stack) {
607 * Pops nodes from the stack back into the graph, coloring them with
610 * If all nodes were trivially colorable, then this must succeed. If
626 struct ra_class *c = g->regs->classes[g->nodes[n].class];
631 g->nodes[n].in_stack = false;
657 g->nodes[n].reg = r;
660 /* Rotate the starting point except for any nodes above the lowest
662 * at allocating optimistically colorable nodes is highly dependent on
663 * the way that the previous nodes popped off the stack are laid out.
665 * file and decreases the number of nearby nodes assigned to the same
689 return g->nodes[n].reg;
697 * input data). These nodes do not end up in the stack during
708 g->nodes[n].reg = reg;
709 g->nodes[n].in_stack = false;
717 int n_class = g->nodes[n].class;
724 for (j = 0; j < g->nodes[n].adjacency_count; j++) {
725 unsigned int n2 = g->nodes[n].adjacency_list[j];
726 unsigned int n2_class = g->nodes[n2].class;
736 * the pq test, or -1 if there are no spillable nodes.
745 /* Consider any nodes that we colored successfully or the node we failed to
747 * only considered these nodes, so spilling any other ones would not result
751 float cost = g->nodes[n].spill_cost;
757 if (g->nodes[n].in_stack)
772 * Only nodes with a spill cost set (cost != 0.0) will be considered
778 g->nodes[n].spill_cost = cost;