This is the mail archive of the gcc-patches@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: [patch] Fix PR tree-optimization/49960 ,Fix self data dependence


On Mon, Oct 17, 2011 at 8:23 AM, Razya Ladelsky <RAZYA@il.ibm.com> wrote:
> This patch fixes the failures described in
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49960
> It also fixes bzips when run with autopar enabled.
>
> In both cases the self dependences are not handled correctly.
> In the first case, a non affine access is analyzed:
> in the second, the distance vector is not calculated correctly (the
> distance vector considered for for self dependences is always (0,0,...))
>
> As ?a result, the loops get wrongfully parallelized.
>
> The patch avoids the special handling of ?self dependences, and analyzes
> all dependences in the same way. Specific adjustments
> and support for the self dependence cases were made.

Can you elaborate on

@@ -3119,8 +3135,11 @@ add_other_self_distances (struct data_dependence_r
 	    {
 	      if (DDR_NUM_SUBSCRIPTS (ddr) != 1)
 		{
-		  DDR_ARE_DEPENDENT (ddr) = chrec_dont_know;
-		  return;
+		  if (DDR_NUM_SUBSCRIPTS (ddr) != 2 || !integer_zerop (DR_ACCESS_FN
(DDR_A (ddr), 1)))
+		    {
+		      DDR_ARE_DEPENDENT (ddr) = chrec_dont_know;
+		      return;
+		    }
 		}

 	      access_fun = DR_ACCESS_FN (DDR_A (ddr), 0);

?  It needed a comment before, and now so even more.

The rest of the patch is ok, I suppose the above hunk is to enhance
something, not
to fix the bug?

Thanks,
Richard.

> Bootstrap and testsuite pass successfully for ppc64-redhat-linux.
>
> OK for trunk?
> Thank you,
> Razya
>
>
> ChangeLog:
>
> ? ? ? ?PR tree-optimization/49960
> ? ? ? ?* tree-data-ref.c (compute_self_dependence): Remove.
> ? ? ? ? ? ? (initialize_data_dependence_relation): Add intializations.
> Remove compute_self_dependence.
> ? ? ? ? ? ? (add_other_self_distances): Add support for two dimensions if
> the second is zero.
> ? ? ? ? ? ? (compute_affine_dependence): Remove the !DDR_SELF_REFERENCE
> condition.
> ? ? ? ? ? ? (compute_all_dependences): Remove call to
> compute_self_dependence. Add call to compute_affine_dependence
>
> testsuite/ChangeLog:
>
> ? ? ? ?PR tree-optimization/49660
> ? ? ? ?* gcc.dg/autopar/pr49660.c: New test.
> ? ? ? ? ? * gcc.dg/autopar/pr49660-1.c: New test.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


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