From aaad77e9f712bb4786a611989c43700104e25098 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 20 Dec 2014 12:17:07 +0100 Subject: [PATCH] isl_ast_codegen.c: move up at_offset This will allow us to call this function from an earlier position. Signed-off-by: Sven Verdoolaege --- isl_ast_codegen.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/isl_ast_codegen.c b/isl_ast_codegen.c index ca8b7b25..e8c0fe0d 100644 --- a/isl_ast_codegen.c +++ b/isl_ast_codegen.c @@ -2244,6 +2244,19 @@ struct isl_find_unroll_data { int *n; }; +/* Return the constraint + * + * i_"depth" = aff + offset + */ +static __isl_give isl_constraint *at_offset(int depth, __isl_keep isl_aff *aff, + int offset) +{ + aff = isl_aff_copy(aff); + aff = isl_aff_add_coefficient_si(aff, isl_dim_in, depth, -1); + aff = isl_aff_add_constant_si(aff, offset); + return isl_equality_from_aff(aff); +} + /* Is the lower bound "lower" with corresponding iteration count "n" * better than the one stored in "data"? * If there is no upper bound on the iteration count ("n" is infinity) or @@ -2387,19 +2400,6 @@ error: return isl_aff_free(data.lower); } -/* Return the constraint - * - * i_"depth" = aff + offset - */ -static __isl_give isl_constraint *at_offset(int depth, __isl_keep isl_aff *aff, - int offset) -{ - aff = isl_aff_copy(aff); - aff = isl_aff_add_coefficient_si(aff, isl_dim_in, depth, -1); - aff = isl_aff_add_constant_si(aff, offset); - return isl_equality_from_aff(aff); -} - /* Data structure for storing the results and the intermediate objects * of compute_domains. * -- 2.11.4.GIT