trverify: cleanup, check irg.entity == entity.irg
[libfirm] / ir / opt / ldstopt.c
index 2711ac4..a396787 100644 (file)
@@ -1815,7 +1815,7 @@ static int cmp_avail_entry(const void *elt, const void *key, size_t size)
  */
 static unsigned hash_cache_entry(const avail_entry_t *entry)
 {
-       return get_irn_idx(entry->ptr) * 9 + HASH_PTR(entry->mode);
+       return get_irn_idx(entry->ptr) * 9 + hash_ptr(entry->mode);
 }  /* hash_cache_entry */
 
 /**
@@ -1831,8 +1831,6 @@ static void move_loads_out_of_loops(scc *pscc, loop_env *env)
        phi_entry *phi_list = NULL;
        set       *avail;
 
-       avail = new_set(cmp_avail_entry, 8);
-
        /* collect all outer memories */
        for (phi = pscc->head; phi != NULL; phi = next) {
                node_entry *ne = get_irn_ne(phi, env);
@@ -1866,6 +1864,8 @@ static void move_loads_out_of_loops(scc *pscc, loop_env *env)
        if (phi_list->next != NULL)
                return;
 
+       avail = new_set(cmp_avail_entry, 8);
+
        for (load = pscc->head; load; load = next) {
                ir_mode *load_mode;
                node_entry *ne = get_irn_ne(load, env);