#include "bespillbelady.h"
#include "bespillmorgan.h"
#include "bespillslots.h"
+#include "bespilloptions.h"
#include "belower.h"
#ifdef WITH_ILP
BE_CH_VRFY_WARN,
};
-/* coalesce spill slots */
-static int coalesce_spill_slots = 1;
-
/** The name of the file where the statistics are put to. */
static char stat_file_name[2048];
static const lc_opt_table_entry_t be_chordal_options[] = {
LC_OPT_ENT_STR ("statfile", "the name of the statisctics file", stat_file_name, sizeof(stat_file_name)),
- LC_OPT_ENT_BOOL ("spill.coal", "coalesce the spill slots (default: yes)", &coalesce_spill_slots),
- LC_OPT_ENT_ENUM_INT ("spill", "spill method (belady, morgan or remat)", &spill_var),
- LC_OPT_ENT_ENUM_PTR ("ifg", "interference graph flavour (std, fast, clique, pointer, list, check)", &ifg_flavor_var),
- LC_OPT_ENT_ENUM_PTR ("perm", "perm lowering options (copy or swap)", &lower_perm_var),
+ LC_OPT_ENT_ENUM_INT ("spill", "spill method", &spill_var),
+ LC_OPT_ENT_ENUM_PTR ("ifg", "interference graph flavour", &ifg_flavor_var),
+ LC_OPT_ENT_ENUM_PTR ("perm", "perm lowering options", &lower_perm_var),
LC_OPT_ENT_ENUM_MASK("dump", "select dump phases", &dump_var),
- LC_OPT_ENT_ENUM_PTR ("vrfy", "verify options (off, warn, assert)", &be_ch_vrfy_var),
+ LC_OPT_ENT_ENUM_PTR ("vrfy", "verify options", &be_ch_vrfy_var),
LC_OPT_ENT_BOOL ("elrsplit", "enable extreme live range splitting", &be_elr_split),
LC_OPT_ENT_INT ("loop_weight", "assumed amount of loop iterations for guessing the execution frequency", &be_loop_weight),
{ NULL }
#ifdef WITH_ILP
be_spill_remat_register_options(chordal_grp);
#endif
+ be_spill_register_options(chordal_grp);
}
}
#endif /* WITH_LIBCORE */
if (! be_is_Reload(irn))
return;
- // only use memory operands, if the reload is only used by 1 node
+ /* always use addressmode, it's good for x86 */
+#if 0
+ /* only use memory operands, if the reload is only used by 1 node */
if(get_irn_n_edges(irn) > 1)
return;
+#endif
spill = be_get_Reload_mem(irn);
block = get_nodes_block(irn);
typedef struct _node_stat_t {
unsigned int n_phis; /**< Phis of the current register class. */
unsigned int n_mem_phis; /**< Memory Phis (Phis with spill operands). */
+ unsigned int n_copies; /**< Copies */
+ unsigned int n_perms; /**< Perms */
unsigned int n_spills; /**< Spill nodes */
- unsigned int n_reloads; /**< Reloads. */
+ unsigned int n_reloads; /**< Reloads */
} node_stat_t;
struct node_stat_walker {
else if(arch_irn_classify(aenv, irn) & arch_irn_class_reload)
++env->stat->n_reloads;
+ else if(arch_irn_classify(aenv, irn) & arch_irn_class_copy)
+ ++env->stat->n_copies;
+
+ else if(arch_irn_classify(aenv, irn) & arch_irn_class_perm)
+ ++env->stat->n_perms;
}
/* a mem phi is a PhiM with a mem phi operand or a Spill operand */
if(stat_file) {
be_ifg_stat_t stat;
- be_ifg_stat(chordal_env.ifg, irg, &stat);
+ be_ifg_stat(&chordal_env, &stat);
be_stat_ev("ifg_nodes", stat.n_nodes);
be_stat_ev("ifg_edges", stat.n_edges);
+ be_stat_ev("ifg_comps", stat.n_comps);
}
BE_TIMER_PUSH(ra_timer.t_verify);
BE_TIMER_POP(ra_timer.t_verify);
+ if(stat_file) {
+ node_stats(&chordal_env, &node_stat);
+ be_stat_ev("perms_before_coal", node_stat.n_perms);
+ be_stat_ev("copies_before_coal", node_stat.n_copies);
+ }
+
/* copy minimization */
BE_TIMER_PUSH(ra_timer.t_copymin);
co_driver(&chordal_env);
BE_TIMER_POP(ra_timer.t_copymin);
+
dump(BE_CH_DUMP_COPYMIN, irg, chordal_env.cls, "-copymin", dump_ir_block_graph_sched);
BE_TIMER_PUSH(ra_timer.t_verify);
pmap_destroy(chordal_env.border_heads);
bitset_free(chordal_env.ignore_colors);
+ if(stat_file) {
+ node_stats(&chordal_env, &node_stat);
+ be_stat_ev("perms_after_coal", node_stat.n_perms);
+ be_stat_ev("copies_after_coal", node_stat.n_copies);
+ }
+
be_stat_ev_pop();
}
BE_TIMER_PUSH(ra_timer.t_spillslots);
- if(coalesce_spill_slots)
be_coalesce_spillslots(&chordal_env);
dump(BE_CH_DUMP_SPILLSLOTS, irg, NULL, "-spillslots", dump_ir_block_graph_sched);
const be_ra_t be_ra_chordal_allocator = {
#ifdef WITH_LIBCORE
be_ra_chordal_register_options,
- be_ra_chordal_main
#else
- 0
+ NULL,
#endif
+ be_ra_chordal_main,
};