/**
* @brief Use the strong normal form theorem (though it does not hold)
* @author Christoph Mallon
- * @version $Id$
*/
#include "config.h"
ir_node* irn;
ir_node* next;
ir_node* last = NULL;
- ir_nodeset_iterator_t iter;
for (irn = inst->curr_list; irn != NULL; last = irn, irn = next) {
next = (ir_node*)get_irn_link(irn);
}
}
- ir_nodeset_iterator_init(&iter, ready_set);
- irn = ir_nodeset_iterator_next(&iter);
- return irn;
+ return ir_nodeset_first(ready_set);
}
const irn_cost_pair* const a1 = (const irn_cost_pair*)a;
const irn_cost_pair* const b1 = (const irn_cost_pair*)b;
int ret;
- if (is_irn_forking(a1->irn)) {
+ if (is_irn_forking(a1->irn) && !is_irn_forking(b1->irn)) {
ret = 1;
- } else if (is_irn_forking(b1->irn)) {
+ } else if (is_irn_forking(b1->irn) && !is_irn_forking(a1->irn)) {
ret = -1;
} else {
ret = b1->cost - a1->cost;
if (ret == 0) {
/* place live-out nodes later */
ret = (count_result(a1->irn) != 0) - (count_result(b1->irn) != 0);
+ if (ret == 0) {
+ /* compare node idx */
+ ret = get_irn_idx(a1->irn) - get_irn_idx(b1->irn);
+ }
}
}
#if defined NORMAL_DBG