From: Sebastian Pop Date: Sat, 13 Mar 2010 17:34:38 +0000 (+0000) Subject: Limit the number of parameters per SCoP. X-Git-Tag: releases/gcc-4.5.0~395 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e7dd37645ae785b9d4d1d06d24a4ee130f2f09b;p=thirdparty%2Fgcc.git Limit the number of parameters per SCoP. 2010-03-09 Sebastian Pop * graphite-sese-to-poly.c (build_poly_scop): Limit scops following the number of parameters in the scop. Use as an upper bound PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS. * params.def (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Declared. * doc/invoke.texi: Document it. From-SVN: r157431 --- diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index 9dcdcdab99b5..61b463bb685b 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,3 +1,11 @@ +2010-03-09 Sebastian Pop + + * graphite-sese-to-poly.c (build_poly_scop): Limit scops following + the number of parameters in the scop. Use as an upper bound + PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS. + * params.def (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Declared. + * doc/invoke.texi: Document it. + 2010-03-05 Sebastian Pop * graphite-sese-to-poly.c (add_param_constraints): Use diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 060be884e0ca..21597017b539 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -8492,6 +8492,10 @@ parameters only when their cumulative size is less or equal to @option{ipa-sra-ptr-growth-factor} times the size of the original pointer parameter. +@item graphite-max-nb-scop-params +To avoid exponential effects in the Graphite loop transforms, the +number of parameters in a SCoP is bounded by 10. + @end table @end table diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c index 11bddf85fd90..ae4a083663a2 100644 --- a/gcc/graphite-sese-to-poly.c +++ b/gcc/graphite-sese-to-poly.c @@ -2937,6 +2937,7 @@ build_poly_scop (scop_p scop) { sese region = SCOP_REGION (scop); sbitmap reductions = sbitmap_alloc (last_basic_block * 2); + graphite_dim_t max_dim; sbitmap_zero (reductions); rewrite_commutative_reductions_out_of_ssa (region, reductions); @@ -2960,6 +2961,10 @@ build_poly_scop (scop_p scop) build_sese_conditions (region); find_scop_parameters (scop); + max_dim = PARAM_VALUE (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS); + if (scop_nb_params (scop) > max_dim) + return false; + build_scop_iteration_domain (scop); build_scop_context (scop); diff --git a/gcc/params.def b/gcc/params.def index 07bfb901f0ba..f6f549c1466b 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -745,6 +745,13 @@ DEFPARAM (PARAM_LOOP_BLOCK_TILE_SIZE, "size of tiles for loop blocking", 51, 0, 0) +/* Maximal number of parameters that we allow in a SCoP. */ + +DEFPARAM (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS, + "graphite-max-nb-scop-params", + "maximal number of parameters in a SCoP", + 10, 0, 0) + /* Avoid doing loop invariant motion on very large loops. */ DEFPARAM (PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP,