-static ir_node *spill_irn(spill_ilp_t *si, ir_node *irn, ir_node *ctx_irn)
-{
- const be_node_factory_t *fact = si->session_env->main_env->node_factory;
- const arch_env_t *arch_env = si->session_env->main_env->arch_env;
- spill_ctx_t *ctx;
-
- ctx = get_spill_ctx(si, irn, ctx_irn);
- if(ctx->spill)
- return ctx->spill;
-
- ctx->spill = be_spill(fact, arch_env, irn);
- return ctx->spill;
-}
-
-static ir_node *spill_phi(spill_ilp_t *si, ir_node *phi, ir_node *ctx_irn, pset *rem_phis)
-{
- int i, n;
- ir_mode *mode = get_irn_mode(phi);
- ir_node **ins;
- ir_node *bl = get_nodes_block(phi);
- ir_graph *irg = get_irn_irg(bl);
- spill_ctx_t *ctx;
-
- assert(is_Phi(phi));
-
- ctx = get_spill_ctx(si, phi, ctx_irn);
- if(ctx->spill)
- return ctx->spill;
-
- n = get_irn_arity(phi);
- ins = malloc(n * sizeof(ins[0]));
-
- for(i = 0; i < n; ++i)
- ins[i] = new_r_Unknown(irg, mode_M);
-
- ctx->spill = new_r_Phi(irg, bl, n, ins, mode_M);
- free(ins);
-
- for(i = 0; i < n; ++i) {
- ir_node *arg = get_irn_n(phi, i);
- ir_node *res;
-
- if(is_Phi(arg))
- res = spill_phi(si, arg, ctx_irn, rem_phis);
- else
- res = spill_irn(si, arg, ctx_irn);
-
- set_irn_n(ctx->spill, i, res);
- }
-
- return ctx->spill;
-}
-
-static ir_node *spill_live_range(spill_ilp_t *si, live_range_t *lr, pset *rem_phis)