Commit 288e850c authored by Christoph Mallon's avatar Christoph Mallon
Browse files

beloopana: Replace be_new_loop_pressure() by be_new_loop_pressure_cls(), but...

beloopana: Replace be_new_loop_pressure() by be_new_loop_pressure_cls(), but use the name of the former.

The register class given by the only caller is never null, so be_new_loop_pressure() behaves like be_new_loop_pressure_cls().
parent f1fcf5fb
......@@ -133,14 +133,7 @@ static unsigned be_compute_loop_pressure(be_loopana_t *loop_ana, ir_loop *loop,
return pressure;
}
/**
* Compute the register pressure for a class of all loops in a graph
* @param irg The graph
* @param cls The register class to compute the pressure for
* @return The loop analysis object.
*/
be_loopana_t *be_new_loop_pressure_cls(ir_graph *irg,
const arch_register_class_t *cls)
be_loopana_t *be_new_loop_pressure(ir_graph *const irg, arch_register_class_t const *const cls)
{
be_loopana_t *loop_ana = XMALLOC(be_loopana_t);
......@@ -158,39 +151,6 @@ be_loopana_t *be_new_loop_pressure_cls(ir_graph *irg,
return loop_ana;
}
/**
* Compute the register pressure for all classes of all loops in the irg.
* @param irg The graph
* @return The loop analysis object.
*/
be_loopana_t *be_new_loop_pressure(ir_graph *irg,
const arch_register_class_t *cls)
{
be_loopana_t *loop_ana = XMALLOC(be_loopana_t);
ir_loop *irg_loop = get_irg_loop(irg);
const arch_env_t *arch_env = be_get_irg_arch_env(irg);
int i;
loop_ana->data = new_set(cmp_loop_info, 16);
loop_ana->irg = irg;
assure_loopinfo(irg);
if (cls != NULL) {
be_compute_loop_pressure(loop_ana, irg_loop, cls);
} else {
for (i = arch_env->n_register_classes - 1; i >= 0; --i) {
const arch_register_class_t *cls = &arch_env->register_classes[i];
DBG((dbg, LEVEL_1, "\n=====================================================\n", cls->name));
DBG((dbg, LEVEL_1, " Computing register pressure for class %s:\n", cls->name));
DBG((dbg, LEVEL_1, "=====================================================\n", cls->name));
be_compute_loop_pressure(loop_ana, irg_loop, cls);
}
}
return loop_ana;
}
/**
* Returns the computed register pressure for the given class and loop.
* @return The pressure or INT_MAX if not found
......
......@@ -24,18 +24,7 @@ typedef struct be_loopana_t be_loopana_t;
* @param cls The register class to compute the pressure for
* @return The loop analysis object.
*/
be_loopana_t *be_new_loop_pressure_cls(ir_graph *irg,
const arch_register_class_t *cls);
/**
* Compute the register pressure of all loops in the irg.
* @param irg The graph
* @param cls register class to compute loop pressure for,
* if NULL computes for all classes
* @return The loop analysis object.
*/
be_loopana_t *be_new_loop_pressure(ir_graph *irg,
const arch_register_class_t *cls);
be_loopana_t *be_new_loop_pressure(ir_graph *irg, arch_register_class_t const *cls);
/**
* Returns the computed register pressure for the given class and loop.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment