- if(irn == it->irn)
- has_started = b->is_def;
-
- /*
- * If the def/use of the node is inside the live range
- * of the node in question, they interfere.
- * To avoid that a node is added twice, we record the
- * visit in the visited number provided by core firm.
- */
- else if(has_started && get_irn_visited(irn) < visited) {
- if(it->build_list)
- obstack_ptr_grow(&it->obst, irn);
-
- set_irn_visited(irn, visited);
- it->degree++;
+ if(irn == it->irn) {
+ if(b->is_def)
+ has_started = 1;
+ else
+ break; /* if we reached the end of the node's lifetime we can safely break */
+ }
+ else if(b->is_def) {
+ /* if any other node than the one in question starts living, add it to the set */
+ pset_insert_ptr(it->neighbours, irn);
+ }
+ else if(!has_started) {
+ /* we only delete, if the live range in question has not yet started */
+ pset_remove_ptr(it->neighbours, irn);