projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
call belower (call lowering)
[libfirm]
/
ir
/
be
/
bechordal.c
diff --git
a/ir/be/bechordal.c
b/ir/be/bechordal.c
index
6ad048c
..
a84ff8c
100644
(file)
--- a/
ir/be/bechordal.c
+++ b/
ir/be/bechordal.c
@@
-53,7
+53,7
@@
#define NO_COLOR (-1)
#define NO_COLOR (-1)
-#
undef
DUMP_INTERVALS
+#
define
DUMP_INTERVALS
typedef struct _be_chordal_alloc_env_t {
be_chordal_env_t *chordal_env;
typedef struct _be_chordal_alloc_env_t {
be_chordal_env_t *chordal_env;
@@
-182,7
+182,6
@@
static int try_pre_color(be_chordal_env_t *env, ir_node *irn,
pset_insert_ptr(pre_colored, irn);
arch_set_irn_register(env->main_env->arch_env, irn, reg);
pset_insert_ptr(pre_colored, irn);
arch_set_irn_register(env->main_env->arch_env, irn, reg);
-
bitset_set(colors_used, col);
DBG((env->dbg, LEVEL_2, "pre coloring %+F with %s\n", irn, reg->name));
bitset_set(colors_used, col);
DBG((env->dbg, LEVEL_2, "pre coloring %+F with %s\n", irn, reg->name));
@@
-290,16
+289,21
@@
static ir_node *handle_constraints_at_perm(be_chordal_alloc_env_t *alloc_env, ir
else
try_pre_color(env, cnstr, pre_colored, colors_used);
else
try_pre_color(env, cnstr, pre_colored, colors_used);
+ pset_insert_pset_ptr(alloc_env->pre_colored, pre_colored);
+
for(irn = pset_first(leftover); irn; irn = pset_next(leftover)) {
const arch_register_t *reg;
ir_node *precol;
int colored = 0;
for(precol = pset_first(pre_colored); precol; precol = pset_next(pre_colored)) {
for(irn = pset_first(leftover); irn; irn = pset_next(leftover)) {
const arch_register_t *reg;
ir_node *precol;
int colored = 0;
for(precol = pset_first(pre_colored); precol; precol = pset_next(pre_colored)) {
+ const arch_register_t *pre_col_reg = arch_get_irn_register(arch_env, precol);
+
if(!values_interfere(irn, precol)) {
if(!values_interfere(irn, precol)) {
- reg = arch_get_irn_register(arch_env, irn);
- arch_set_irn_register(arch_env, irn, reg);
+ reg = arch_get_irn_register(arch_env, precol);
pset_break(pre_colored);
pset_break(pre_colored);
+ pset_remove_ptr(pre_colored, precol);
+ DBG((dbg, LEVEL_2, "non-interfering %+F setting to %s\n", irn, reg->name));
colored = 1;
break;
}
colored = 1;
break;
}
@@
-308,17
+312,16
@@
static ir_node *handle_constraints_at_perm(be_chordal_alloc_env_t *alloc_env, ir
if(!colored) {
int col = bitset_next_clear(colors_used, 0);
if(!colored) {
int col = bitset_next_clear(colors_used, 0);
- assert(col >=
0
&& "There must be a register left");
+ assert(col >=
0 && col < env->cls->n_regs
&& "There must be a register left");
reg = arch_register_for_index(env->cls, col);
reg = arch_register_for_index(env->cls, col);
- arch_set_irn_register(arch_env, irn, reg);
- bitset_set(colors_used, reg->index);
- pset_insert_ptr(alloc_env->pre_colored, irn);
DBG((dbg, LEVEL_2, "coloring leftover %+F with %s\n", irn, reg->name));
}
DBG((dbg, LEVEL_2, "coloring leftover %+F with %s\n", irn, reg->name));
}
- }
- pset_insert_pset_ptr(alloc_env->pre_colored, pre_colored);
+ arch_set_irn_register(arch_env, irn, reg);
+ pset_insert_ptr(alloc_env->pre_colored, irn);
+ bitset_set(colors_used, reg->index);
+ }
del_pset(leftover);
del_pset(pre_colored);
del_pset(leftover);
del_pset(pre_colored);
@@
-521,8
+524,6
@@
static void assign(ir_node *block, void *env_ptr)
const arch_register_t *reg;
int col = NO_COLOR;
const arch_register_t *reg;
int col = NO_COLOR;
- DBG((dbg, LEVEL_4, "\tcolors in use: %b\n", colors));
-
if(pset_find_ptr(alloc_env->pre_colored, irn)) {
reg = arch_get_irn_register(arch_env, irn);
col = reg->index;
if(pset_find_ptr(alloc_env->pre_colored, irn)) {
reg = arch_get_irn_register(arch_env, irn);
col = reg->index;
@@
-595,10
+596,10
@@
void be_ra_chordal_color(be_chordal_env_t *chordal_env)
char buf[128];
plotter_t *plotter;
char buf[128];
plotter_t *plotter;
- ir_snprintf(buf, sizeof(buf), "ifg_%s_%F.eps", cls->name, irg);
+ ir_snprintf(buf, sizeof(buf), "ifg_%s_%F.eps", c
hordal_env->c
ls->name, irg);
plotter = new_plotter_ps(buf);
plotter = new_plotter_ps(buf);
- draw_interval_tree(&draw_chordal_def_opts, chordal_env, plotter
, env->arch_env, cls
);
+ draw_interval_tree(&draw_chordal_def_opts, chordal_env, plotter);
plotter_free(plotter);
}
#endif
plotter_free(plotter);
}
#endif