X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbespill.h;h=79c82cec3fe791972e2c781e23cee39f0a317596;hb=fffd92a72a25a017f310ab5037af449e42fe0b88;hp=8dc58911c188597b48416588386d0de11f52e5d9;hpb=787aa344dc18020fd8d8600e190156413cc98564;p=libfirm diff --git a/ir/be/bespill.h b/ir/be/bespill.h index 8dc58911c..79c82cec3 100644 --- a/ir/be/bespill.h +++ b/ir/be/bespill.h @@ -19,21 +19,13 @@ #include "bearch.h" typedef struct _spill_env_t spill_env_t; -typedef int(*decide_irn_t)(const ir_node*, void*); /** * Creates a new spill environment. * * @param chordal - * @param is_spilled_phi a function that evaluates a phi node and returns true if it is a spilled phi node - * @param data context parameter for the is_spilled_phi function */ -spill_env_t *be_new_spill_env(const be_chordal_env_t *chordal, decide_irn_t is_spilled_phi, void *data); - -/** - * (re-)sets the is_spilled_phi callback - */ -void be_set_is_spilled_phi(spill_env_t *env, decide_irn_t is_spilled_phi, void *data); +spill_env_t *be_new_spill_env(const be_chordal_env_t *chordal); /** * Deletes a spill environment. @@ -44,7 +36,21 @@ void be_add_reload(spill_env_t *senv, ir_node *to_spill, ir_node *before); void be_add_reload_on_edge(spill_env_t *senv, ir_node *to_spill, ir_node *bl, int pos); -void be_insert_spills_reloads(spill_env_t *senv, pset *reload_set); +void be_insert_spills_reloads(spill_env_t *senv); + +/** + * Marks a phi-node for spilling. So when reloading from this phi-node, not + * only its value but the whole phi will be spilled. + * This might place be_Copy nodes in predecessor blocks. + */ +void be_spill_phi(spill_env_t *env, ir_node *node); + +/** + * Places the necessary copies for the spilled phis in the graph + * This has to be done once before be_insert_spill_reloads, after + * all phis to spill have been marked with be_spill_phi. + */ +void be_place_copies(spill_env_t *env); /** * Computes the spill offsets for all spill nodes in the irg