Commit 9099772e authored by Matthias Braun's avatar Matthias Braun
Browse files

use custom spillslot coalescer so int->float and float->int gets proper spillslots

[r27824]
parent 07354fc9
......@@ -230,11 +230,57 @@ static void sparc_after_ra_walker(ir_node *block, void *data)
}
}
static void sparc_collect_frame_entity_nodes(ir_node *node, void *data)
{
be_fec_env_t *env = data;
const ir_mode *mode;
int align;
ir_entity *entity;
const sparc_load_store_attr_t *attr;
if (be_is_Reload(node) && be_get_frame_entity(node) == NULL) {
mode = get_irn_mode(node);
align = get_mode_size_bytes(mode);
be_node_needs_frame_entity(env, node, mode, align);
return;
}
if (!is_sparc_Ld(node) && !is_sparc_Ldf(node))
return;
attr = get_sparc_load_store_attr_const(node);
entity = attr->entity;
mode = attr->load_store_mode;
align = get_mode_size_bytes(mode);
if (entity != NULL)
return;
if (!attr->is_frame_entity)
return;
be_node_needs_frame_entity(env, node, mode, align);
}
static void sparc_set_frame_entity(ir_node *node, ir_entity *entity)
{
if (is_be_node(node)) {
be_node_set_frame_entity(node, entity);
} else {
/* we only say be_node_needs_frame_entity on nodes with load_store
* attributes, so this should be fine */
sparc_load_store_attr_t *attr = get_sparc_load_store_attr(node);
attr->entity = entity;
}
}
static void sparc_after_ra(void *self)
{
sparc_code_gen_t *cg = self;
be_coalesce_spillslots(cg->irg);
sparc_code_gen_t *cg = self;
ir_graph *irg = cg->irg;
be_fec_env_t *fec_env = be_new_frame_entity_coalescer(irg);
irg_walk_graph(irg, NULL, sparc_collect_frame_entity_nodes, fec_env);
be_assign_entities(fec_env, sparc_set_frame_entity);
be_free_frame_entity_coalescer(fec_env);
irg_block_walk_graph(cg->irg, NULL, sparc_after_ra_walker, NULL);
}
......
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