create execution frequencies from profile data
[libfirm] / ir / be / bespill.c
index 366439f..fad86bc 100644 (file)
@@ -32,6 +32,7 @@
 #include "benode_t.h"
 #include "bechordal_t.h"
 #include "bejavacoal.h"
+#include "benodesets.h"
 
 // only rematerialise when costs are less than REMAT_COST_LIMIT
 // TODO determine a good value here...
@@ -82,7 +83,7 @@ static int cmp_spillinfo(const void *x, const void *y, size_t size) {
  */
 static spill_info_t *get_spillinfo(const spill_env_t *env, ir_node *value) {
        spill_info_t info, *res;
-       int hash = HASH_PTR(value);
+       int hash = nodeset_hash(value);
 
        info.spilled_node = value;
        res = set_find(env->spills, &info, sizeof(info), hash);
@@ -185,6 +186,7 @@ void be_add_reload_on_edge(spill_env_t *env, ir_node *to_spill, ir_node *block,
 }
 
 void be_spill_phi(spill_env_t *env, ir_node *node) {
+       spill_info_t* spill;
        int i, arity;
 
        assert(is_Phi(node));
@@ -192,7 +194,7 @@ void be_spill_phi(spill_env_t *env, ir_node *node) {
        pset_insert_ptr(env->mem_phis, node);
 
        // create spillinfos for the phi arguments
-       spill_info_t* spill = get_spillinfo(env, node);
+       spill = get_spillinfo(env, node);
        for(i = 0, arity = get_irn_arity(node); i < arity; ++i) {
                ir_node *arg = get_irn_n(node, i);
                get_spillinfo(env, arg);
@@ -201,7 +203,6 @@ void be_spill_phi(spill_env_t *env, ir_node *node) {
        // if we had a spill for the phi value before, then remove this spill from
        // schedule, as we will remove it in the insert spill/reload phase
        if(spill->spill != NULL && !is_Phi(spill->spill)) {
-               //sched_remove(spill->spill);
                spill->old_spill = spill->spill;
                spill->spill = NULL;
        }