Patchwork Fix PR47576 and PR47555: add PARAM_SCEV_MAX_PATH_LENGTH.

login
register
mail settings
Submitter Sebastian Pop
Date Feb. 1, 2011, 7:49 p.m.
Message ID <1296589762-7532-1-git-send-email-sebpop@gmail.com>
Download mbox | patch
Permalink /patch/81367/
State New
Headers show

Comments

Sebastian Pop - Feb. 1, 2011, 7:49 p.m.
Hi Richi,

with this patch we now compile pr47555.c in 4553 kB, and it makes
pr42732.f and the whole graphite testsuite work again.

I am regstraping this on amd64-linux.  Ok for trunk?

Thanks,
Sebastian

2011-02-01  Sebastian Pop  <sebastian.pop@amd.com>

	PR tree-optimization/47576
	PR tree-optimization/47555
	* doc/invoke.texi (scev-max-path-length): Documented.
	* params.def (PARAM_SCEV_MAX_EXPR_SIZE): Bump the value to 100.
	(PARAM_SCEV_MAX_PATH_LENGTH): Declared.
	* tree-scalar-evolution.c (follow_ssa_edge): Use
	PARAM_SCEV_MAX_PATH_LENGTH.
---
 gcc/ChangeLog               |   10 ++++++++++
 gcc/doc/invoke.texi         |    4 ++++
 gcc/params.def              |    7 ++++++-
 gcc/tree-scalar-evolution.c |    2 +-
 4 files changed, 21 insertions(+), 2 deletions(-)
Richard Guenther - Feb. 1, 2011, 10:30 p.m.
On Tue, Feb 1, 2011 at 8:49 PM, Sebastian Pop <sebpop@gmail.com> wrote:
> Hi Richi,
>
> with this patch we now compile pr47555.c in 4553 kB, and it makes
> pr42732.f and the whole graphite testsuite work again.
>
> I am regstraping this on amd64-linux.  Ok for trunk?

In principle it's ok, but the value does not limit path length - it limits
the number of branches in the tree.  Thus I think something more
abstract, like scev-max-expression-complexity would be more appropriate.
The documentation has to be modified accordingly.

Richard.

> Thanks,
> Sebastian
>
> 2011-02-01  Sebastian Pop  <sebastian.pop@amd.com>
>
>        PR tree-optimization/47576
>        PR tree-optimization/47555
>        * doc/invoke.texi (scev-max-path-length): Documented.
>        * params.def (PARAM_SCEV_MAX_EXPR_SIZE): Bump the value to 100.
>        (PARAM_SCEV_MAX_PATH_LENGTH): Declared.
>        * tree-scalar-evolution.c (follow_ssa_edge): Use
>        PARAM_SCEV_MAX_PATH_LENGTH.
> ---
>  gcc/ChangeLog               |   10 ++++++++++
>  gcc/doc/invoke.texi         |    4 ++++
>  gcc/params.def              |    7 ++++++-
>  gcc/tree-scalar-evolution.c |    2 +-
>  4 files changed, 21 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index e5c4b37..626d8f7 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,5 +1,15 @@
>  2011-02-01  Sebastian Pop  <sebastian.pop@amd.com>
>
> +       PR tree-optimization/47576
> +       PR tree-optimization/47555
> +       * doc/invoke.texi (scev-max-path-length): Documented.
> +       * params.def (PARAM_SCEV_MAX_EXPR_SIZE): Bump the value to 100.
> +       (PARAM_SCEV_MAX_PATH_LENGTH): Declared.
> +       * tree-scalar-evolution.c (follow_ssa_edge): Use
> +       PARAM_SCEV_MAX_PATH_LENGTH.
> +
> +2011-02-01  Sebastian Pop  <sebastian.pop@amd.com>
> +
>        PR tree-optimization/47561
>        * toplev.c (process_options): Print the Graphite flags.  Add
>        flag_loop_flatten to the list of options requiring Graphite.
> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> index b25d8cf..f639965 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -8463,6 +8463,10 @@ optimization when a new iv is added to the set.
>  Bound on size of expressions used in the scalar evolutions analyzer.
>  Large expressions slow the analyzer.
>
> +@item scev-max-path-length
> +Bound on length of the use-def path walked by the scalar evolutions
> +analyzer.  Long paths slow the analyzer.
> +
>  @item omega-max-vars
>  The maximum number of variables in an Omega constraint system.
>  The default value is 128.
> diff --git a/gcc/params.def b/gcc/params.def
> index 3138bc2..d3b4a16 100644
> --- a/gcc/params.def
> +++ b/gcc/params.def
> @@ -481,7 +481,12 @@ DEFPARAM(PARAM_IV_ALWAYS_PRUNE_CAND_SET_BOUND,
>  DEFPARAM(PARAM_SCEV_MAX_EXPR_SIZE,
>         "scev-max-expr-size",
>         "Bound on size of expressions used in the scalar evolutions analyzer",
> -        20, 0, 0)
> +        100, 0, 0)
> +
> +DEFPARAM(PARAM_SCEV_MAX_PATH_LENGTH,
> +        "scev-max-path-length",
> +        "Bound on the length of the use-def path walked by the scalar evolutions analyzer",
> +        10, 0, 0)
>
>  DEFPARAM(PARAM_OMEGA_MAX_VARS,
>         "omega-max-vars",
> diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
> index d60e569..86c659c 100644
> --- a/gcc/tree-scalar-evolution.c
> +++ b/gcc/tree-scalar-evolution.c
> @@ -1399,7 +1399,7 @@ follow_ssa_edge (struct loop *loop, gimple def, gimple halting_phi,
>     return t_false;
>
>   /* Give up if the path is longer than the MAX that we allow.  */
> -  if (limit > PARAM_VALUE (PARAM_SCEV_MAX_EXPR_SIZE))
> +  if (limit > PARAM_VALUE (PARAM_SCEV_MAX_PATH_LENGTH))
>     return t_dont_know;
>
>   def_loop = loop_containing_stmt (def);
> --
> 1.7.1
>
>

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e5c4b37..626d8f7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,15 @@ 
 2011-02-01  Sebastian Pop  <sebastian.pop@amd.com>
 
+	PR tree-optimization/47576
+	PR tree-optimization/47555
+	* doc/invoke.texi (scev-max-path-length): Documented.
+	* params.def (PARAM_SCEV_MAX_EXPR_SIZE): Bump the value to 100.
+	(PARAM_SCEV_MAX_PATH_LENGTH): Declared.
+	* tree-scalar-evolution.c (follow_ssa_edge): Use
+	PARAM_SCEV_MAX_PATH_LENGTH.
+
+2011-02-01  Sebastian Pop  <sebastian.pop@amd.com>
+
 	PR tree-optimization/47561
 	* toplev.c (process_options): Print the Graphite flags.  Add
 	flag_loop_flatten to the list of options requiring Graphite.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index b25d8cf..f639965 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -8463,6 +8463,10 @@  optimization when a new iv is added to the set.
 Bound on size of expressions used in the scalar evolutions analyzer.
 Large expressions slow the analyzer.
 
+@item scev-max-path-length
+Bound on length of the use-def path walked by the scalar evolutions
+analyzer.  Long paths slow the analyzer.
+
 @item omega-max-vars
 The maximum number of variables in an Omega constraint system.
 The default value is 128.
diff --git a/gcc/params.def b/gcc/params.def
index 3138bc2..d3b4a16 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -481,7 +481,12 @@  DEFPARAM(PARAM_IV_ALWAYS_PRUNE_CAND_SET_BOUND,
 DEFPARAM(PARAM_SCEV_MAX_EXPR_SIZE,
  	 "scev-max-expr-size",
 	 "Bound on size of expressions used in the scalar evolutions analyzer",
-	 20, 0, 0)
+	 100, 0, 0)
+
+DEFPARAM(PARAM_SCEV_MAX_PATH_LENGTH,
+	 "scev-max-path-length",
+	 "Bound on the length of the use-def path walked by the scalar evolutions analyzer",
+	 10, 0, 0)
 
 DEFPARAM(PARAM_OMEGA_MAX_VARS,
  	 "omega-max-vars",
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index d60e569..86c659c 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -1399,7 +1399,7 @@  follow_ssa_edge (struct loop *loop, gimple def, gimple halting_phi,
     return t_false;
 
   /* Give up if the path is longer than the MAX that we allow.  */
-  if (limit > PARAM_VALUE (PARAM_SCEV_MAX_EXPR_SIZE))
+  if (limit > PARAM_VALUE (PARAM_SCEV_MAX_PATH_LENGTH))
     return t_dont_know;
 
   def_loop = loop_containing_stmt (def);