[PATCH 6/6] Move loop flattening and SLP vectorization at the end of loop transforms.

Richard Guenther rguenther@suse.de
Fri Oct 29 13:44:00 GMT 2010


On Thu, 28 Oct 2010, Sebastian Pop wrote:

> 2010-10-20  Sebastian Pop  <sebastian.pop@amd.com>
> 
> 	* passes.c (init_optimization_passes): Move pass_flatten_loops and
> 	pass_slp_vectorize at the end of the loop transforms.
> ---
>  gcc/ChangeLog |    5 +++++
>  gcc/passes.c  |    4 ++--
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index 8907244..d1215cb 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,5 +1,10 @@
>  2010-10-20  Sebastian Pop  <sebastian.pop@amd.com>
>  
> +	* passes.c (init_optimization_passes): Move pass_flatten_loops and
> +	pass_slp_vectorize at the end of the loop transforms.
> +
> +2010-10-20  Sebastian Pop  <sebastian.pop@amd.com>
> +
>  	* passes.c (init_optimization_passes): Do not call pass_if_conversion
>  	after pass_flatten_loops.
>  	* tree-flow.h (gate_tree_if_conversion): Declared.
> diff --git a/gcc/passes.c b/gcc/passes.c
> index ed81018..82d5c74 100644
> --- a/gcc/passes.c
> +++ b/gcc/passes.c
> @@ -913,11 +913,11 @@ init_optimization_passes (void)
>  	    }
>            NEXT_PASS (pass_predcom);
>  	  NEXT_PASS (pass_complete_unroll);
> -	  NEXT_PASS (pass_flatten_loops);
> -	  NEXT_PASS (pass_slp_vectorize);
>  	  NEXT_PASS (pass_parallelize_loops);
>  	  NEXT_PASS (pass_loop_prefetch);
>  	  NEXT_PASS (pass_iv_optimize);
> +	  NEXT_PASS (pass_flatten_loops);
> +	  NEXT_PASS (pass_slp_vectorize);
>  	  NEXT_PASS (pass_tree_loop_done);

IVOPTs should certainly be after SLP.  I also don't expect loop
flattening to introduce SLP opportunities (I'd be curious for
a testcase where it does so).  Which means simply moving flattening
after IVOPTs should be all.

Richard.



More information about the Gcc-patches mailing list