-/**
- * Adds a spill to a variable. Sets all pointers accordingly.
- */
-static INLINE var_info_t *var_add_spill(be_raext_env_t *raenv, int var_to_spill, ir_node *before) {
- var_info_t *vi = var_find_or_insert(raenv->vars, var_to_spill);
- ir_node *blk, *tospill, *spill;
-
- assert(pset_count(vi->values) && "There are no values associated to this variable");
- assert(!vi->reload_phase && "I have already seen a reload for this variable, so you cant spill anymore!");
-
- /* add spill to graph and schedule */
- blk = get_nodes_block(before);
- tospill = dom_up_search(vi->values, before); /* which value gets spilled */
- spill = be_new_Spill(raenv->cls, raenv->irg, blk, tospill, tospill); /* the corresponding spill node */
-
- sched_add_before(before, spill);
-
- /* the spill also points to the var_info of the spilled node */
- set_var_info(spill, vi);
-
- /* remember the spill */
- pset_insert_ptr(vi->spills, spill);
-
- return vi;
-}
-
-/**
- * Adds a reload to a variable. Sets all pointers accordingly.
- */
-static INLINE var_info_t *var_add_reload(be_raext_env_t *raenv, int var_to_reload, int var_nr_for_reload, ir_node *before) {
- var_info_t *vi = var_find_or_insert(raenv->vars, var_to_reload);
- ir_node *blk, *spill, *reload;
-
- assert(pset_count(vi->spills) && "There are no spills associated to this variable");
- /* now we enter the reload phase, so no more spills are allowed */
- vi->reload_phase = 1;
-
- /* add reload to graph and schedule */
- blk = get_nodes_block(before);
- spill = pset_first(vi->spills); /* For now use an arbitrary spill node. This is corrected later in fix_reloads */
- pset_break(vi->spills);
- reload = be_new_Reload(raenv->cls, raenv->irg, blk, get_irn_mode(get_irn_n(spill, 0)), spill);
-
- sched_add_before(before, reload);
-
- /* create a new variable for the result of the reload */
- assert(!var_find(raenv->vars, var_nr_for_reload) && "Each reload must define a new variable");
- var_add_value(raenv, var_nr_for_reload, reload);
-
- /* remember the reload */
- pset_insert_ptr(vi->reloads, reload);
-
- return vi;
-}
-