Commit 07615f9f authored by Matthias Braun's avatar Matthias Braun
Browse files

remove old spillslot coalescing API

parent 342720ec
......@@ -216,9 +216,33 @@ static void amd64_after_ra_walker(ir_node *block, void *data)
}
}
static void amd64_set_frame_entity(ir_node *node, ir_entity *entity)
{
assert(be_is_Reload(node));
be_node_set_frame_entity(node, entity);
}
/**
* Collects nodes that need frame entities assigned.
*/
static void amd64_collect_frame_entity_nodes(ir_node *node, void *data)
{
if (be_is_Reload(node) && be_get_frame_entity(node) == NULL) {
be_fec_env_t *env = (be_fec_env_t*)data;
const ir_mode *mode = get_irn_mode(node);
int align = get_mode_size_bytes(mode);
be_node_needs_frame_entity(env, node, mode, align);
}
}
static void amd64_after_ra(ir_graph *irg)
{
be_coalesce_spillslots(irg);
be_fec_env_t *fec_env = be_new_frame_entity_coalescer(irg);
/* create and coalesce frame entities */
irg_walk_graph(irg, NULL, amd64_collect_frame_entity_nodes, fec_env);
be_assign_entities(fec_env, amd64_set_frame_entity);
be_free_frame_entity_coalescer(fec_env);
irg_block_walk_graph(irg, NULL, amd64_after_ra_walker, NULL);
}
......
......@@ -800,43 +800,6 @@ void be_assign_entities(be_fec_env_t *env,
create_memperms(env);
}
/**
* This walker function searches for reloads and collects all the spills
* and memphis attached to them.
*/
static void collect_spills_walker(ir_node *node, void *data)
{
be_fec_env_t *env = (be_fec_env_t*)data;
const ir_mode *mode;
const arch_register_class_t *cls;
int align;
ir_graph *irg;
const arch_env_t *arch_env;
if (! (arch_irn_classify(node) & arch_irn_class_reload))
return;
mode = get_irn_mode(node);
cls = arch_get_irn_reg_class_out(node);
irg = get_irn_irg(node);
arch_env = be_get_irg_arch_env(irg);
align = arch_env_get_reg_class_alignment(arch_env, cls);
be_node_needs_frame_entity(env, node, mode, align);
}
void be_coalesce_spillslots(ir_graph *irg)
{
be_fec_env_t *env = be_new_frame_entity_coalescer(irg);
/* collect reloads */
irg_walk_graph(irg, NULL, collect_spills_walker, env);
be_assign_entities(env, be_node_set_frame_entity);
be_free_frame_entity_coalescer(env);
}
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spillslots);
void be_init_spillslots(void)
{
......
......@@ -62,15 +62,4 @@ typedef void (*set_frame_entity_func)(ir_node *node, ir_entity *entity);
*/
void be_assign_entities(be_fec_env_t *env, set_frame_entity_func set_frame);
//-------------------------------------------------------------------
// Old API
//-------------------------------------------------------------------
/**
* Assigns frame entities to all spill nodes in the irg.
* Coalesces spillslots and minimizes the number of memcopies induced by
* memory-phis.
*/
void be_coalesce_spillslots(ir_graph *irg);
#endif
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