[PATCH]: Improve data ref disambiguation

Zdenek Dvorak rakdver@kam.mff.cuni.cz
Wed Jun 6 07:05:00 GMT 2007


Hello,

> Right now, we currently decide that if two base objects are not
> operand_equal_p, they must have different base objects.
> 
> We can do slightly better.
> 
> If the vops on the datarefs are exactly equal, they must have the same
> base object.
> 
> IE:
> 
> (gdb) p debug_generic_stmt (a->stmt)
> # VUSE <PARM_NOALIAS.4_22, PARM_NOALIAS.5_14, SMT.6_39> {
> PARM_NOALIAS.4 PARM_NOALIAS.5 SMT.6 }
> D.1886_24 = *D.1885_23;
> 
> $1 = void
> (gdb) p debug_generic_stmt (b->stmt)
> # VUSE <PARM_NOALIAS.4_22, PARM_NOALIAS.5_14, SMT.6_39> {
> PARM_NOALIAS.4 PARM_NOALIAS.5 SMT.6 }
> D.1888_28 = *D.1887_27;
> 
> 
> Dereferences of these pointers can touch exactly the same memory, so
> they must share a base object (there is no guarantee they have the
> same offsets, etc, only that their pointers can only touch the same
> set of memory).

is this patch really correct? The rest of code in
initialize_data_dependence_relation, as well as
compute_affine_dependence, assumes that DR_BASE_OBJECTs are exactly
equal).

Zdenek

> 
> Bootstrapped and regtested on i686-pc-linux-gnu
> 
> Committed to mainline
> 
> 2007-06-05  Daniel Berlin  <dberlin@dberlin.org>
> 
> 	* tree-data-ref.c (initialize_data_dependence_relation): Two
> 	objects also access the same base object if they have the same set
> 	of vops.

> Index: tree-data-ref.c
> ===================================================================
> --- tree-data-ref.c	(revision 125352)
> +++ tree-data-ref.c	(working copy)
> @@ -1217,7 +1217,8 @@ initialize_data_dependence_relation (str
>  
>    /* If the references do not access the same object, we do not know
>       whether they alias or not.  */
> -  if (!operand_equal_p (DR_BASE_OBJECT (a), DR_BASE_OBJECT (b), 0))
> +  if (!operand_equal_p (DR_BASE_OBJECT (a), DR_BASE_OBJECT (b), 0)
> +      && !bitmap_equal_p (DR_VOPS (a), DR_VOPS (b)))
>      {
>        DDR_ARE_DEPENDENT (res) = chrec_dont_know;    
>        return res;



More information about the Gcc-patches mailing list