- /* Blocks cannot be scheduled. */
- if (is_Block(irn))
- return 0;
-
- /*
- * Check, if the given ir node is in a different block as the
- * currently scheduled one. If that is so, don't make the node ready.
- */
- if (env->block != get_nodes_block(irn))
- return 0;
-
- for (i = 0, n = get_irn_ins_or_deps(irn); i < n; ++i) {
- ir_node *op = get_irn_in_or_dep(irn, i);
-
- /* if irn is an End we have keep-alives and op might be a block, skip that */
- if (is_Block(op)) {
- assert(get_irn_op(irn) == op_End);
- continue;
- }
-
- /* If the operand is local to the scheduled block and not yet
- * scheduled, this nodes cannot be made ready, so exit. */
- if (! is_already_scheduled(env, op) && get_nodes_block(op) == env->block)
- return 0;
- }
-
- nodeset_insert(env->cands, irn);
-
- /* Notify selector about the ready node. */
- if (env->selector->node_ready)
- env->selector->node_ready(env->selector_block_env, irn, pred);
-
- DB((env->dbg, LEVEL_2, "\tmaking ready: %+F\n", irn));
-
- return 1;
-}
-
-/**
- * Try, to make all users of a node ready.
- * In fact, a usage node can only be made ready, if all its operands
- * have already been scheduled yet. This is checked my make_ready().
- * @param env The block schedule environment.
- * @param irn The node, which usages (successors) are to be made ready.
- */
-static INLINE void make_users_ready(block_sched_env_t *env, ir_node *irn)
-{
- const ir_edge_t *edge;
-
- foreach_out_edge(irn, edge) {
- ir_node *user = get_edge_src_irn(edge);
- if (! is_Phi(user))
- make_ready(env, irn, user);
- }
-
- foreach_out_edge_kind(irn, edge, EDGE_KIND_DEP) {
- ir_node *user = get_edge_src_irn(edge);
- if (! is_Phi(user))
- make_ready(env, irn, user);
+ /* we schedule one block at a time, so no need to consider users in other
+ * blocks */
+ if (is_Block(irn) || get_nodes_block(irn) != env->block)
+ return;
+ if (is_Phi(irn) || is_End(irn))
+ return;
+ /* check if all operands are already available */
+ n = get_irn_ins_or_deps(irn);
+ for (i = 0; i < n; ++i) {
+ ir_node *op = get_irn_in_or_dep(irn, i);
+
+ /* If the operand is local to the scheduled block and not yet
+ * scheduled, this nodes cannot be made ready, so exit. */
+ if (get_nodes_block(op) == env->block
+ && !is_already_scheduled(env->sched_env, op))
+ return;