- irg_block_walk_graph((ir_graph *) irg, block_sched_dumper, NULL, f);
+ sched_info_t *info = get_irn_sched_info(irn);
+ const sched_info_t *prev_info = get_irn_sched_info(info->prev);
+ const sched_info_t *next_info = get_irn_sched_info(info->next);
+ sched_timestep_t before_ts = prev_info->time_step;
+ sched_timestep_t after_ts = next_info->time_step;
+
+ /*
+ * If we are the last, we can give us a big time step,
+ * else we have to compute our time step from our
+ * neighbours.
+ */
+ if(before_ts >= after_ts) {
+ info->time_step = before_ts + SCHED_INITIAL_GRANULARITY;
+ /* overflow? */
+ if (info->time_step <= before_ts) {
+ sched_renumber(get_nodes_block(irn));
+ }
+ } else {
+ sched_timestep_t ts = (before_ts + after_ts) / 2;
+
+ /*
+ * If the resolution went out, we have to renumber
+ * this block.
+ */
+ if(ts == before_ts || ts == after_ts)
+ sched_renumber(get_nodes_block(irn));
+ else
+ info->time_step = ts;
+ }