Commit f9991643 authored by Daniel Grund's avatar Daniel Grund
Browse files

Bugfixes related to pos-changes of the spill node

parent eed1c09d
......@@ -98,6 +98,10 @@ enum {
be_pos_Reload_mem = 1
};
ir_node *be_new_Reload(const arch_register_class_t *cls, const arch_register_class_t *cls_frame, ir_graph *irg, ir_node *bl, ir_node *frame, ir_node *spill_node, ir_mode *mode);
enum {
be_pos_Copy_orig = 0
};
ir_node *be_new_Copy(const arch_register_class_t *cls, ir_graph *irg, ir_node *block, ir_node *in);
ir_node *be_new_Perm(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, int arity, ir_node *in[]);
ir_node *be_new_Keep(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, int arity, ir_node *in[]);
......
......@@ -623,7 +623,7 @@ static void dump_affinities_walker(ir_node *irn, void *env) {
/* 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);
......@@ -754,7 +754,7 @@ static INLINE void var_add_spills_and_reloads(be_raext_env_t *raenv, int var_nr)
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)
......@@ -796,8 +796,7 @@ static INLINE void var_add_spills_and_reloads(be_raext_env_t *raenv, int var_nr)
/* ...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);
}
}
......
......@@ -312,7 +312,7 @@ static void compute_spill_slots_walker(ir_node *spill, void *env) {
/* this is a new spill context */
ss = obstack_alloc(&ssenv->ob, sizeof(*ss));
ss->members = pset_new_ptr(8);
ss->largest_mode = get_irn_mode(get_irn_n(spill, 0));
ss->largest_mode = get_irn_mode(get_irn_n(spill, be_pos_Spill_val));
ss->size = get_mode_size_bytes(ss->largest_mode);
ss->align = ss->size; /* TODO Assumed for now */
pmap_insert(ssenv->slots, ctx, ss);
......@@ -320,7 +320,7 @@ static void compute_spill_slots_walker(ir_node *spill, void *env) {
ir_node *irn;
/* values with the same spill_ctx must go into the same spill slot */
ss = entry->value;
assert(ss->size == (unsigned)get_mode_size_bytes(get_irn_mode(get_irn_n(spill, 0))) && "Different sizes for the same spill slot are not allowed yet.");
assert(ss->size == (unsigned)get_mode_size_bytes(get_irn_mode(get_irn_n(spill, be_pos_Spill_val))) && "Different sizes for the same spill slot are not allowed yet.");
for (irn = pset_first(ss->members); irn; irn = pset_next(ss->members)) {
/* use values_interfere here, because it uses the dominance check,
which does work for values in memory */
......
......@@ -595,7 +595,7 @@ static void remove_copies(belady_env_t *bel) {
user = get_irn_edge(get_irn_irg(irn), irn, 0)->src;
src = get_irn_n(irn, 0);
src = get_irn_n(irn, be_pos_Copy_orig);
set_irn_n(user, 0, src);
}
}
......@@ -612,7 +612,7 @@ static void remove_unused_reloads(ir_graph *irg, belady_env_t *bel) {
ir_node *spill;
DBG((dbg, DBG_SPILL, "Removing %+F before %+F in %+F\n", irn, sched_next(irn), get_nodes_block(irn)));
spill = get_irn_n(irn, 0);
spill = get_irn_n(irn, be_pos_Reload_mem);
/* remove reload */
set_irn_n(irn, 0, new_Bad());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment