}
}
+#define UNSPILLABLE -1
+
static INLINE int get_spill_costs(be_raext_env_t *raenv, var_info_t *vi) {
ir_node *irn;
int c_spills=0, c_reloads=0;
pset_foreach(vi->values, irn) {
- if (arch_irn_is_ignore(raenv->aenv, irn)) {
+ if (arch_irn_is_ignore(raenv->aenv, irn) || be_is_Reload(irn)) {
pset_break(vi->values);
- return -1;
+ return UNSPILLABLE;
}
if (is_Phi(irn)) {
/* copies have affinities */
if (arch_irn_classify(raenv->aenv, irn) == arch_irn_class_copy) {
- ir_node *other = get_irn_n(irn, 0);
+ ir_node *other = get_irn_n(irn, be_pos_Copy_orig);
if (! arch_irn_is_ignore(raenv->aenv, other)) {
vi2 = get_var_info(other);
assert(spill && "There must be at least one non-phi-node");
- mode = get_irn_mode(get_irn_n(spill, 0));
+ mode = get_irn_mode(get_irn_n(spill, be_pos_Spill_val));
/* insert reloads and wire them arbitrary*/
pset_foreach(vi->values, irn)
/* ...add new vars for each non-phi-member */
pset_foreach(spills, irn) {
- ir_node *spilled = get_irn_n(irn, 1);
- assert(get_irn_node_nr(spilled) != 1089);
+ ir_node *spilled = get_irn_n(irn, be_pos_Spill_val);
raenv->cls_vars[raenv->n_cls_vars++] = var_add_value(raenv, get_irn_node_nr(spilled), spilled);
}
}