summaryrefslogtreecommitdiffhomepage
path: root/ir/be/becopyilp2.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2011-12-01 19:50:46 +0100
committerMatthias Braun <matze@braunis.de>2011-12-01 20:14:17 +0100
commitb6de8e65b56fb153061505d65d10548f40daf8f5 (patch)
tree32e03f999fdb9a95063a901124b76e57d509d2b5 /ir/be/becopyilp2.c
parent846df6812a98f4c43073e16bdb22a0fdbe09289e (diff)
copyopt: miscellaneous code cleanups
Diffstat (limited to 'ir/be/becopyilp2.c')
-rw-r--r--ir/be/becopyilp2.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/ir/be/becopyilp2.c b/ir/be/becopyilp2.c
index 800a617..14b7675 100644
--- a/ir/be/becopyilp2.c
+++ b/ir/be/becopyilp2.c
@@ -512,8 +512,11 @@ static void ilp2_apply(ilp_env_t *ienv)
lpp_sol_state_t state = lpp_get_solution(ienv->lp, sol, lenv->first_x_var, lenv->last_x_var);
if (state != lpp_optimal) {
- printf("WARNING %s: Solution state is not 'optimal': %d\n", ienv->co->name, (int)state);
- assert(state >= lpp_feasible && "The solution should at least be feasible!");
+ printf("WARNING %s: Solution state is not 'optimal': %d\n",
+ ienv->co->name, (int)state);
+ if (state < lpp_feasible) {
+ panic("Copy coalescing solution not feasible!");
+ }
}
for (i=0; i<count; ++i) {
@@ -545,17 +548,13 @@ static void ilp2_apply(ilp_env_t *ienv)
#endif
}
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyilp2)
-void be_init_copyilp2(void)
-{
- static co_algo_info copyheur = {
- co_solve_ilp2, 1
- };
-
- be_register_copyopt("ilp", &copyheur);
-}
-
-int co_solve_ilp2(copy_opt_t *co)
+/**
+ * Solves the problem using mixed integer programming
+ * @returns 1 iff solution state was optimal
+ * Uses the OU and the GRAPH data structure
+ * Dependency of the OU structure can be removed
+ */
+static int co_solve_ilp2(copy_opt_t *co)
{
lpp_sol_state_t sol_state;
ilp_env_t *ienv;
@@ -583,3 +582,13 @@ int co_solve_ilp2(copy_opt_t *co)
return sol_state == lpp_optimal;
}
+
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyilp2)
+void be_init_copyilp2(void)
+{
+ static co_algo_info copyheur = {
+ co_solve_ilp2, 1
+ };
+
+ be_register_copyopt("ilp", &copyheur);
+}