- const irn_cost_pair* a1 = a;
- const irn_cost_pair* b1 = b;
- return b1->cost - a1->cost;
+ const irn_cost_pair* const a1 = a;
+ const irn_cost_pair* const b1 = b;
+ int ret;
+ if (is_irn_forking(a1->irn)) {
+ ret = 1;
+ } else if (is_irn_forking(b1->irn)) {
+ ret = -1;
+ } else {
+ ret = b1->cost - a1->cost;
+ //ret = a1->cost - b1->cost;
+ }
+#if defined NORMAL_DBG
+ ir_fprintf(stderr, "%+F %s %+F\n", a1->irn, ret < 0 ? "<" : ret > 0 ? ">" : "=", b1->irn);
+#endif
+ return ret;