+static loc_t to_take_or_not_to_take(belady_env_t *env, ir_node* first, ir_node *node, ir_node *block, ir_loop *loop) {
+ be_next_use_t next_use;
+ loc_t loc;
+ loc.time = USES_INFINITY;
+
+ if (!arch_irn_consider_in_reg_alloc(env->arch, env->cls, node)) {
+ loc.time = USES_INFINITY;
+ return loc;
+ }
+
+ loc.irn = node;
+
+ /* We have to keep nonspillable nodes in the workingset */
+ if(arch_irn_get_flags(env->arch, node) & arch_irn_flags_dont_spill) {
+ loc.time = 0;
+ DBG((dbg, DBG_START, " %+F taken (dontspill node)\n", node, loc.time));
+ return loc;
+ }
+
+ next_use = be_get_next_use(env->uses, first, 0, node, 0);
+ if(USES_IS_INFINITE(next_use.time)) {
+ // the nodes marked as live in shouldn't be dead, so it must be a phi
+ loc.time = USES_INFINITY;
+ DBG((dbg, DBG_START, " %+F not taken (dead)\n", node));
+ assert(is_Phi(node));
+ return loc;
+ }
+
+ loc.time = next_use.time;
+
+ if(next_use.outermost_loop >= get_loop_depth(loop)) {
+ DBG((dbg, DBG_START, " %+F taken (%u, loop %d)\n", node, loc.time, next_use.outermost_loop));
+ return loc;
+ // ARR_APP1(loc_t, starters, loc);
+ } else {
+ loc.time = USES_INFINITY;
+ DBG((dbg, DBG_START, " %+F not taken (outerloopdepth %d < loopdetph %d)\n", node, next_use.outermost_loop, get_loop_depth(loop)));
+ return loc;
+ }
+}
+
+/*
+ * Computes set of live-ins for each block with multiple predecessors
+ * and notifies spill algorithm which phis need to be spilled