Commit 9f259c73 authored by Sebastian Hack's avatar Sebastian Hack
Browse files

Developed further... might be unstable. so don't use for the moment.

spill placement to be done.

[r15765]
parent fba7027d
...@@ -69,6 +69,7 @@ DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) ...@@ -69,6 +69,7 @@ DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
typedef struct reloader_t reloader_t; typedef struct reloader_t reloader_t;
struct reloader_t { struct reloader_t {
reloader_t *next; reloader_t *next;
ir_node *can_spill_after;
ir_node *reloader; ir_node *reloader;
ir_node *rematted_node; ir_node *rematted_node;
int remat_cost_delta; /** costs needed for rematerialization, int remat_cost_delta; /** costs needed for rematerialization,
...@@ -209,7 +210,7 @@ void be_add_remat(spill_env_t *env, ir_node *to_spill, ir_node *before, ...@@ -209,7 +210,7 @@ void be_add_remat(spill_env_t *env, ir_node *to_spill, ir_node *before,
to_spill, before)); to_spill, before));
} }
void be_add_reload(spill_env_t *env, ir_node *to_spill, ir_node *before, void be_add_reload2(spill_env_t *env, ir_node *to_spill, ir_node *before, ir_node *can_spill_after,
const arch_register_class_t *reload_cls, int allow_remat) const arch_register_class_t *reload_cls, int allow_remat)
{ {
spill_info_t *info; spill_info_t *info;
...@@ -244,15 +245,12 @@ void be_add_reload(spill_env_t *env, ir_node *to_spill, ir_node *before, ...@@ -244,15 +245,12 @@ void be_add_reload(spill_env_t *env, ir_node *to_spill, ir_node *before,
assert(!is_Proj(before) && !be_is_Keep(before)); assert(!is_Proj(before) && !be_is_Keep(before));
/* put reload into list */ /* put reload into list */
rel = obstack_alloc(&env->obst, sizeof(rel[0])); rel = obstack_alloc(&env->obst, sizeof(rel[0]));
rel->next = info->reloaders; rel->next = info->reloaders;
rel->reloader = before; rel->reloader = before;
rel->rematted_node = NULL; rel->rematted_node = NULL;
if(!allow_remat) { rel->can_spill_after = can_spill_after;
rel->remat_cost_delta = REMAT_COST_INFINITE; rel->remat_cost_delta = allow_remat ? 0 : REMAT_COST_INFINITE;
} else {
rel->remat_cost_delta = 0;
}
info->reloaders = rel; info->reloaders = rel;
assert(info->reload_cls == NULL || info->reload_cls == reload_cls); assert(info->reload_cls == NULL || info->reload_cls == reload_cls);
...@@ -262,6 +260,13 @@ void be_add_reload(spill_env_t *env, ir_node *to_spill, ir_node *before, ...@@ -262,6 +260,13 @@ void be_add_reload(spill_env_t *env, ir_node *to_spill, ir_node *before,
to_spill, before, allow_remat ? "" : " not")); to_spill, before, allow_remat ? "" : " not"));
} }
void be_add_reload(spill_env_t *senv, ir_node *to_spill, ir_node *before,
const arch_register_class_t *reload_cls, int allow_remat)
{
be_add_reload2(senv, to_spill, before, to_spill, reload_cls, allow_remat);
}
ir_node *be_get_end_of_block_insertion_point(const ir_node *block) ir_node *be_get_end_of_block_insertion_point(const ir_node *block)
{ {
ir_node *last = sched_last(block); ir_node *last = sched_last(block);
......
...@@ -65,6 +65,9 @@ ir_node *be_get_end_of_block_insertion_point(const ir_node *block); ...@@ -65,6 +65,9 @@ ir_node *be_get_end_of_block_insertion_point(const ir_node *block);
void be_add_reload(spill_env_t *senv, ir_node *to_spill, ir_node *before, void be_add_reload(spill_env_t *senv, ir_node *to_spill, ir_node *before,
const arch_register_class_t *reload_cls, int allow_remat); const arch_register_class_t *reload_cls, int allow_remat);
void be_add_reload2(spill_env_t *senv, ir_node *to_spill, ir_node *before, ir_node *can_spill_after,
const arch_register_class_t *reload_cls, int allow_remat);
/** /**
* Add a reload at the end of a block. * Add a reload at the end of a block.
* Similar to be_add_reload_on_edge(). * Similar to be_add_reload_on_edge().
......
This diff is collapsed.
Supports Markdown
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