Remove dumping the -am graph. It is exactly the same as the -opt graph.
[libfirm] / ir / be / bespill.c
index f13938d..04c8860 100644 (file)
@@ -24,9 +24,7 @@
  * @date               29.09.2005
  * @version     $Id$
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <stdlib.h>
 #include <stdbool.h>
@@ -55,7 +53,6 @@
 #include "belive_t.h"
 #include "benode_t.h"
 #include "bechordal_t.h"
-#include "bejavacoal.h"
 #include "bespilloptions.h"
 #include "bestatevent.h"
 #include "bessaconstr.h"
@@ -200,7 +197,7 @@ void be_add_spill(spill_env_t *env, ir_node *to_spill, ir_node *after)
        spill_t      *s;
        spill_t      *last;
 
-       assert(! arch_irn_is(env->arch_env, to_spill, dont_spill));
+       assert(!arch_irn_is(to_spill, dont_spill));
        DB((dbg, LEVEL_1, "Add spill of %+F after %+F\n", to_spill, after));
 
        /* Just for safety make sure that we do not insert the spill in front of a phi */
@@ -266,7 +263,7 @@ void be_add_reload2(spill_env_t *env, ir_node *to_spill, ir_node *before,
        spill_info_t *info;
        reloader_t *rel;
 
-       assert(! arch_irn_is(env->arch_env, to_spill, dont_spill));
+       assert(!arch_irn_is(to_spill, dont_spill));
 
        info = get_spillinfo(env, to_spill);
 
@@ -447,7 +444,7 @@ static void spill_irn(spill_env_t *env, spill_info_t *spillinfo)
 
                after = skip_keeps_phis(after);
 
-               spill->spill   = be_spill(env->arch_env, block, to_spill);
+               spill->spill = be_spill(block, to_spill);
                sched_add_after(after, spill->spill);
                DB((dbg, LEVEL_1, "\t%+F after %+F\n", spill->spill, after));
 #ifdef FIRM_STATISTICS
@@ -573,7 +570,7 @@ static int is_value_available(spill_env_t *env, const ir_node *arg,
        /*
         * Ignore registers are always available
         */
-       if(arch_irn_is(env->arch_env, arg, ignore)) {
+       if (arch_irn_is(arg, ignore)) {
                return 1;
        }
 
@@ -605,13 +602,11 @@ static int is_value_available(spill_env_t *env, const ir_node *arg,
 /**
  * Checks whether the node can principally be rematerialized
  */
-static int is_remat_node(spill_env_t *env, const ir_node *node)
+static int is_remat_node(const ir_node *node)
 {
-       const arch_env_t *arch_env = env->arch_env;
-
        assert(!be_is_Spill(node));
 
-       if(arch_irn_is(arch_env, node, rematerializable))
+       if (arch_irn_is(node, rematerializable))
                return 1;
 
        return 0;
@@ -634,7 +629,7 @@ static int check_remat_conditions_costs(spill_env_t *env,
        int argremats;
        int costs = 0;
 
-       if(!is_remat_node(env, spilled))
+       if (!is_remat_node(spilled))
                return REMAT_COST_INFINITE;
 
        if(be_is_Reload(spilled)) {
@@ -645,7 +640,7 @@ static int check_remat_conditions_costs(spill_env_t *env,
        if(parentcosts + costs >= env->reload_cost + env->spill_cost) {
                return REMAT_COST_INFINITE;
        }
-       if(arch_irn_is(env->arch_env, spilled, modify_flags)) {
+       if (arch_irn_is(spilled, modify_flags)) {
                return REMAT_COST_INFINITE;
        }
 
@@ -804,7 +799,7 @@ static void determine_spill_costs(spill_env_t *env, spill_info_t *spillinfo)
        if(spillinfo->spill_costs >= 0)
                return;
 
-       assert(! arch_irn_is(env->arch_env, to_spill, dont_spill));
+       assert(!arch_irn_is(to_spill, dont_spill));
        assert(!be_is_Reload(to_spill));
 
        /* some backends have virtual noreg/unknown nodes that are not scheduled
@@ -840,7 +835,7 @@ static void determine_spill_costs(spill_env_t *env, spill_info_t *spillinfo)
                spill_t *s;
                double   spills_execfreq;
 
-               /* calculate sum of executaion frequencies of individual spills */
+               /* calculate sum of execution frequencies of individual spills */
                spills_execfreq = 0;
                s               = spillinfo->spills;
                for( ; s != NULL; s = s->next) {
@@ -909,7 +904,6 @@ void make_spill_locations_dominate_irn(spill_env_t *env, ir_node *irn)
 
 void be_insert_spills_reloads(spill_env_t *env)
 {
-       const arch_env_t      *arch_env  = env->arch_env;
        const ir_exec_freq    *exec_freq = env->exec_freq;
        spill_info_t          *si;
        ir_nodeset_iterator_t  iter;
@@ -1012,7 +1006,7 @@ void be_insert_spills_reloads(spill_env_t *env)
                                /* create a reload, use the first spill for now SSA
                                 * reconstruction for memory comes below */
                                assert(si->spills != NULL);
-                               copy = be_reload(arch_env, si->reload_cls, rld->reloader, mode,
+                               copy = be_reload(si->reload_cls, rld->reloader, mode,
                                                 si->spills->spill);
 #ifdef FIRM_STATISTICS
                                env->reload_count++;