- If the operand has no partner or the partner has not been marked
- for allocation, determine the admissible registers and mark it
- for allocation by associating the node and its partner with the
- set of admissible registers via a bipartite graph.
- */
- if(!op->partner || !pmap_contains(partners, op->partner->carrier)) {
-
- pmap_insert(partners, op->carrier, op->partner ? op->partner->carrier : NULL);
+ * If the operand has no partner or the partner has not been marked
+ * for allocation, determine the admissible registers and mark it
+ * for allocation by associating the node and its partner with the
+ * set of admissible registers via a bipartite graph.
+ */
+ if (!op->partner || !pmap_contains(partners, op->partner->carrier)) {
+ ir_node *partner = op->partner ? op->partner->carrier : NULL;
+ int i;
+
+ pmap_insert(partners, op->carrier, partner);
+ if (partner != NULL)
+ pmap_insert(partners, partner, op->carrier);
+
+ /* don't insert a node twice */
+ for (i = 0; i < n_alloc; ++i) {
+ if (alloc_nodes[i] == op->carrier) {
+ break;
+ }
+ }
+ if (i < n_alloc)
+ continue;
+