This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [autovect][PATCH]: Re: Simple loops not interchanged?


On Sat, Dec 11, 2004 at 10:58:50PM -0500, Daniel Berlin wrote:
>  
> Index: tree-data-ref.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/tree-data-ref.c,v
> retrieving revision 2.15.4.2
> diff -u -p -r2.15.4.2 tree-data-ref.c
> --- tree-data-ref.c	30 Nov 2004 20:28:38 -0000	2.15.4.2
> +++ tree-data-ref.c	12 Dec 2004 03:47:21 -0000
> @@ -1812,12 +1812,19 @@ analyze_overlapping_iterations (tree chr
>        fprintf (dump_file, ")\n");
>      }
>    
> -  if (chrec_a == NULL_TREE
> -      || chrec_b == NULL_TREE
> -      || chrec_contains_undetermined (chrec_a)
> -      || chrec_contains_undetermined (chrec_b)
> -      || chrec_contains_symbols (chrec_a)
> -      || chrec_contains_symbols (chrec_b))
> +  /* If they are the same chrec, they overlap on every iteration.  */
> +  if (chrec_a == chrec_b)
> +    {
> +      *overlap_iterations_a = integer_zero_node;
> +      *overlap_iterations_b = integer_zero_node;
> +      *last_conflicts = chrec_dont_know;
> +    }  

Are you really sure that you want this behavior?

chrec_a = chrec_dont_know
chrec_b = chrec_dont_know

or even the following: 

chrec_a = {0, +, chrec_dont_know}
chrec_b = {0, +, chrec_dont_know}

results in having determined overlap iterations when the analysis
should have answered "don't know".  The condition is a little too
strong I think.

> +  else if (chrec_a == NULL_TREE
> +	   || chrec_b == NULL_TREE
> +	   || chrec_contains_undetermined (chrec_a)
> +	   || chrec_contains_undetermined (chrec_b)
> +	   || chrec_contains_symbols (chrec_a)
> +	   || chrec_contains_symbols (chrec_b))
>      {
>        dependence_stats.num_unimplemented++;
>        

What you want is something like:

if (chrec_a == NULL_TREE
   || chrec_b == NULL_TREE
   || chrec_contains_undetermined (chrec_a)
   || chrec_contains_undetermined (chrec_b))
{
  undetermined
}
else if (chrec_a == chrec_b
	&& symbols_in_chrec_are_invariant_p (chrec_a))
{
  overlaps every iteration
}
else if (chrec_contains_symbols (chrec_a)
	|| chrec_contains_symbols (chrec_b))
{
  undetermined
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]