From 18933fc04fa4fb91a2aac1875c040c9bb14049fd Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 18 Sep 2009 09:02:40 +0200 Subject: [PATCH] isl_tab_pip: use generalized basis reduction based context by default --- include/isl_ctx.h | 4 ++++ isl_ctx.c | 1 + isl_tab_pip.c | 15 +++++++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/include/isl_ctx.h b/include/isl_ctx.h index 0839d55..644b9b6 100644 --- a/include/isl_ctx.h +++ b/include/isl_ctx.h @@ -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 diff --git a/isl_ctx.c b/isl_ctx.c index a9e29f7..66e3c6b 100644 --- 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; diff --git a/isl_tab_pip.c b/isl_tab_pip.c index 8595eba..003197e 100644 --- a/isl_tab_pip.c +++ b/isl_tab_pip.c @@ -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; -- 2.7.4