isl_tab_pip: use generalized basis reduction based context by default
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 18 Sep 2009 07:02:40 +0000 (09:02 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 10 Oct 2009 11:16:33 +0000 (13:16 +0200)
include/isl_ctx.h
isl_ctx.c
isl_tab_pip.c

index 0839d55..644b9b6 100644 (file)
@@ -73,6 +73,10 @@ struct isl_ctx {
        #define                 ISL_PIP_PIP     1
        unsigned                pip;
 
+       #define                 ISL_CONTEXT_GBR         0
+       #define                 ISL_CONTEXT_LEXMIN      1
+       unsigned                context;
+
        #define                 ISL_GBR_NEVER   0
        #define                 ISL_GBR_ONCE    1
        #define                 ISL_GBR_ALWAYS  2
index a9e29f7..66e3c6b 100644 (file)
--- a/isl_ctx.c
+++ b/isl_ctx.c
@@ -38,6 +38,7 @@ struct isl_ctx *isl_ctx_alloc()
        ctx->lp_solver = ISL_LP_TAB;
        ctx->ilp_solver = ISL_ILP_GBR;
        ctx->pip = ISL_PIP_TAB;
+       ctx->context = ISL_CONTEXT_GBR;
 
        ctx->gbr = ISL_GBR_ONCE;
        ctx->gbr_only_first = 0;
index 8595eba..003197e 100644 (file)
@@ -2563,6 +2563,17 @@ error:
        return NULL;
 }
 
+static struct isl_context *isl_context_alloc(struct isl_basic_set *dom)
+{
+       if (!dom)
+               return NULL;
+
+       if (dom->ctx->context == ISL_CONTEXT_LEXMIN)
+               return isl_context_lex_alloc(dom);
+       else
+               return isl_context_gbr_alloc(dom);
+}
+
 /* Construct an isl_sol_map structure for accumulating the solution.
  * If track_empty is set, then we also keep track of the parts
  * of the context where there is no solution.
@@ -2587,7 +2598,7 @@ static struct isl_sol_map *sol_map_init(struct isl_basic_map *bmap,
        if (!sol_map->map)
                goto error;
 
-       sol_map->sol.context = isl_context_lex_alloc(dom);
+       sol_map->sol.context = isl_context_alloc(dom);
        if (!sol_map->sol.context)
                goto error;
 
@@ -3405,7 +3416,7 @@ static struct isl_sol_for *sol_for_init(struct isl_basic_map *bmap, int max,
        sol_for->sol.add = &sol_for_add_wrap;
        sol_for->sol.free = &sol_for_free_wrap;
 
-       sol_for->sol.context = isl_context_lex_alloc(dom);
+       sol_for->sol.context = isl_context_alloc(dom);
        if (!sol_for->sol.context)
                goto error;