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 PR26859


On 3/31/06, Sebastian Pop <sebpop@gmail.com> wrote:
> Here is the patch that bootstrapped on amd64-linux, I'll commit it
> after it passes testing.
>
Actually this previous patch did not passed testing because the dependence
analyzer uses chrec_fold operations that had inconsistent typed operands.
The following patch corrects these problems.  Bootstrapped and tested on
amd64-linux.  Committed to trunk as revision 112621.

Sebastian
2006-04-02  Sebastian Pop  <pop@cri.ensmp.fr>

	* tree-scalar-evolution.c (add_to_evolution_1): Pass an extra argument
	at_stmt.  Convert the type of operands before calling 
	build_polynomial_chrec.
	(add_to_evolution): Pass an extra argument at_stmt.  Adjust the call to
	add_to_evolution_1.
	(follow_ssa_edge_in_rhs): Adjust call to add_to_evolution.
	(instantiate_parameters_1): Convert the type of operands before calling 
	build_polynomial_chrec.
	* tree-chrec.c (chrec_fold_poly_cst, chrec_fold_plus_poly_poly,
	chrec_fold_multiply_poly_poly, chrec_replace_initial_condition,
	reset_evolution_in_loop): Insert asserts to check the types of the
	operands.
	(chrec_type): Moved...
	(eq_evolutions_p): Use operand_equal_p.
	* tree-chrec.h (build_polynomial_chrec): Insert an assert to check
	the types of the operands.
	(chrec_type): ...here.
	* tree-data-ref.c (create_data_ref): Convert the operands before
	calling chrec_replace_initial_condition.
	(same_access_functions, analyze_subscript_affine_affine,
	analyze_miv_subscript, all_chrecs_equal_p): Use eq_evolutions_p.
	(compute_subscript_distance, analyze_ziv_subscript,
	analyze_siv_subscript_cst_affine, compute_overlap_steps_for_affine_1_2,
	analyze_miv_subscript): Convert the operands before calling
	chrec_fold_minus or chrec_fold_plus.

Index: tree-scalar-evolution.c
===================================================================
*** tree-scalar-evolution.c	(revision 112501)
--- tree-scalar-evolution.c	(working copy)
*************** get_scalar_evolution (tree scalar)
*** 659,676 ****
     part for this loop.  */
  
  static tree
! add_to_evolution_1 (unsigned loop_nb, 
! 		    tree chrec_before, 
! 		    tree to_add)
  {
    switch (TREE_CODE (chrec_before))
      {
      case POLYNOMIAL_CHREC:
        if (CHREC_VARIABLE (chrec_before) <= loop_nb)
  	{
  	  unsigned var;
! 	  tree left, right;
! 	  tree type = chrec_type (chrec_before);
  	  
  	  /* When there is no evolution part in this loop, build it.  */
  	  if (CHREC_VARIABLE (chrec_before) < loop_nb)
--- 659,677 ----
     part for this loop.  */
  
  static tree
! add_to_evolution_1 (unsigned loop_nb, tree chrec_before, tree to_add,
! 		    tree at_stmt)
  {
+   tree type, left, right;
+ 
    switch (TREE_CODE (chrec_before))
      {
      case POLYNOMIAL_CHREC:
        if (CHREC_VARIABLE (chrec_before) <= loop_nb)
  	{
  	  unsigned var;
! 
! 	  type = chrec_type (chrec_before);
  	  
  	  /* When there is no evolution part in this loop, build it.  */
  	  if (CHREC_VARIABLE (chrec_before) < loop_nb)
*************** add_to_evolution_1 (unsigned loop_nb, 
*** 688,708 ****
  	      right = CHREC_RIGHT (chrec_before);
  	    }
  
! 	  return build_polynomial_chrec 
! 	    (var, left, chrec_fold_plus (type, right, to_add));
  	}
        else
! 	/* Search the evolution in LOOP_NB.  */
! 	return build_polynomial_chrec 
! 	  (CHREC_VARIABLE (chrec_before),
! 	   add_to_evolution_1 (loop_nb, CHREC_LEFT (chrec_before), to_add),
! 	   CHREC_RIGHT (chrec_before));
        
      default:
        /* These nodes do not depend on a loop.  */
        if (chrec_before == chrec_dont_know)
  	return chrec_dont_know;
!       return build_polynomial_chrec (loop_nb, chrec_before, to_add);
      }
  }
  
--- 689,718 ----
  	      right = CHREC_RIGHT (chrec_before);
  	    }
  
! 	  to_add = chrec_convert (type, to_add, at_stmt);
! 	  right = chrec_convert (type, right, at_stmt);
! 	  right = chrec_fold_plus (type, right, to_add);
! 	  return build_polynomial_chrec (var, left, right);
  	}
        else
! 	{
! 	  /* Search the evolution in LOOP_NB.  */
! 	  left = add_to_evolution_1 (loop_nb, CHREC_LEFT (chrec_before),
! 				     to_add, at_stmt);
! 	  right = CHREC_RIGHT (chrec_before);
! 	  right = chrec_convert (chrec_type (left), right, at_stmt);
! 	  return build_polynomial_chrec (CHREC_VARIABLE (chrec_before),
! 					 left, right);
! 	}
        
      default:
        /* These nodes do not depend on a loop.  */
        if (chrec_before == chrec_dont_know)
  	return chrec_dont_know;
! 
!       left = chrec_before;
!       right = chrec_convert (chrec_type (left), to_add, at_stmt);
!       return build_polynomial_chrec (loop_nb, left, right);
      }
  }
  
*************** add_to_evolution_1 (unsigned loop_nb, 
*** 841,850 ****
  */
  
  static tree 
! add_to_evolution (unsigned loop_nb, 
! 		  tree chrec_before,
! 		  enum tree_code code,
! 		  tree to_add)
  {
    tree type = chrec_type (to_add);
    tree res = NULL_TREE;
--- 851,858 ----
  */
  
  static tree 
! add_to_evolution (unsigned loop_nb, tree chrec_before, enum tree_code code,
! 		  tree to_add, tree at_stmt)
  {
    tree type = chrec_type (to_add);
    tree res = NULL_TREE;
*************** add_to_evolution (unsigned loop_nb, 
*** 874,880 ****
  				  ? build_real (type, dconstm1)
  				  : build_int_cst_type (type, -1));
  
!   res = add_to_evolution_1 (loop_nb, chrec_before, to_add);
  
    if (dump_file && (dump_flags & TDF_DETAILS))
      {
--- 882,888 ----
  				  ? build_real (type, dconstm1)
  				  : build_int_cst_type (type, -1));
  
!   res = add_to_evolution_1 (loop_nb, chrec_before, to_add, at_stmt);
  
    if (dump_file && (dump_flags & TDF_DETAILS))
      {
*************** follow_ssa_edge_in_rhs (struct loop *loo
*** 1094,1100 ****
  		*evolution_of_loop = add_to_evolution 
  		  (loop->num, 
  		   chrec_convert (type_rhs, evol, at_stmt), 
! 		   PLUS_EXPR, rhs1);
  	      
  	      else if (res == t_false)
  		{
--- 1102,1108 ----
  		*evolution_of_loop = add_to_evolution 
  		  (loop->num, 
  		   chrec_convert (type_rhs, evol, at_stmt), 
! 		   PLUS_EXPR, rhs1, at_stmt);
  	      
  	      else if (res == t_false)
  		{
*************** follow_ssa_edge_in_rhs (struct loop *loo
*** 1106,1112 ****
  		    *evolution_of_loop = add_to_evolution 
  		      (loop->num, 
  		       chrec_convert (type_rhs, *evolution_of_loop, at_stmt), 
! 		       PLUS_EXPR, rhs0);
  
  		  else if (res == t_dont_know)
  		    *evolution_of_loop = chrec_dont_know;
--- 1114,1120 ----
  		    *evolution_of_loop = add_to_evolution 
  		      (loop->num, 
  		       chrec_convert (type_rhs, *evolution_of_loop, at_stmt), 
! 		       PLUS_EXPR, rhs0, at_stmt);
  
  		  else if (res == t_dont_know)
  		    *evolution_of_loop = chrec_dont_know;
*************** follow_ssa_edge_in_rhs (struct loop *loo
*** 1127,1133 ****
  		*evolution_of_loop = add_to_evolution 
  		  (loop->num, chrec_convert (type_rhs, *evolution_of_loop,
  					     at_stmt),
! 		   PLUS_EXPR, rhs1);
  
  	      else if (res == t_dont_know)
  		*evolution_of_loop = chrec_dont_know;
--- 1135,1141 ----
  		*evolution_of_loop = add_to_evolution 
  		  (loop->num, chrec_convert (type_rhs, *evolution_of_loop,
  					     at_stmt),
! 		   PLUS_EXPR, rhs1, at_stmt);
  
  	      else if (res == t_dont_know)
  		*evolution_of_loop = chrec_dont_know;
*************** follow_ssa_edge_in_rhs (struct loop *loo
*** 1145,1151 ****
  	    *evolution_of_loop = add_to_evolution 
  	      (loop->num, chrec_convert (type_rhs, *evolution_of_loop,
  					 at_stmt),
! 	       PLUS_EXPR, rhs0);
  
  	  else if (res == t_dont_know)
  	    *evolution_of_loop = chrec_dont_know;
--- 1153,1159 ----
  	    *evolution_of_loop = add_to_evolution 
  	      (loop->num, chrec_convert (type_rhs, *evolution_of_loop,
  					 at_stmt),
! 	       PLUS_EXPR, rhs0, at_stmt);
  
  	  else if (res == t_dont_know)
  	    *evolution_of_loop = chrec_dont_know;
*************** follow_ssa_edge_in_rhs (struct loop *loo
*** 1175,1181 ****
  	  if (res == t_true)
  	    *evolution_of_loop = add_to_evolution 
  	      (loop->num, chrec_convert (type_rhs, *evolution_of_loop, at_stmt),
! 	       MINUS_EXPR, rhs1);
  
  	  else if (res == t_dont_know)
  	    *evolution_of_loop = chrec_dont_know;
--- 1183,1189 ----
  	  if (res == t_true)
  	    *evolution_of_loop = add_to_evolution 
  	      (loop->num, chrec_convert (type_rhs, *evolution_of_loop, at_stmt),
! 	       MINUS_EXPR, rhs1, at_stmt);
  
  	  else if (res == t_dont_know)
  	    *evolution_of_loop = chrec_dont_know;
*************** instantiate_parameters_1 (struct loop *l
*** 2043,2049 ****
  
        if (CHREC_LEFT (chrec) != op0
  	  || CHREC_RIGHT (chrec) != op1)
! 	chrec = build_polynomial_chrec (CHREC_VARIABLE (chrec), op0, op1);
        return chrec;
  
      case PLUS_EXPR:
--- 2051,2060 ----
  
        if (CHREC_LEFT (chrec) != op0
  	  || CHREC_RIGHT (chrec) != op1)
! 	{
! 	  op1 = chrec_convert (chrec_type (op0), op1, NULL_TREE);
! 	  chrec = build_polynomial_chrec (CHREC_VARIABLE (chrec), op0, op1);
! 	}
        return chrec;
  
      case PLUS_EXPR:
Index: tree-chrec.c
===================================================================
*** tree-chrec.c	(revision 112501)
--- tree-chrec.c	(working copy)
*************** chrec_fold_poly_cst (enum tree_code code
*** 63,69 ****
    gcc_assert (cst);
    gcc_assert (TREE_CODE (poly) == POLYNOMIAL_CHREC);
    gcc_assert (!is_not_constant_evolution (cst));
!   
    switch (code)
      {
      case PLUS_EXPR:
--- 63,70 ----
    gcc_assert (cst);
    gcc_assert (TREE_CODE (poly) == POLYNOMIAL_CHREC);
    gcc_assert (!is_not_constant_evolution (cst));
!   gcc_assert (type == chrec_type (poly));
! 
    switch (code)
      {
      case PLUS_EXPR:
*************** chrec_fold_plus_poly_poly (enum tree_cod
*** 103,108 ****
--- 104,111 ----
    gcc_assert (poly1);
    gcc_assert (TREE_CODE (poly0) == POLYNOMIAL_CHREC);
    gcc_assert (TREE_CODE (poly1) == POLYNOMIAL_CHREC);
+   gcc_assert (chrec_type (poly0) == chrec_type (poly1));
+   gcc_assert (type == chrec_type (poly0));
    
    /*
      {a, +, b}_1 + {c, +, d}_2  ->  {{a, +, b}_1 + c, +, d}_2,
*************** chrec_fold_multiply_poly_poly (tree type
*** 177,182 ****
--- 180,187 ----
    gcc_assert (poly1);
    gcc_assert (TREE_CODE (poly0) == POLYNOMIAL_CHREC);
    gcc_assert (TREE_CODE (poly1) == POLYNOMIAL_CHREC);
+   gcc_assert (chrec_type (poly0) == chrec_type (poly1));
+   gcc_assert (type == chrec_type (poly0));
    
    /* {a, +, b}_1 * {c, +, d}_2  ->  {c*{a, +, b}_1, +, d}_2,
       {a, +, b}_2 * {c, +, d}_1  ->  {a*{c, +, d}_1, +, b}_2,
*************** chrec_fold_automatically_generated_opera
*** 246,255 ****
  /* Fold the addition of two chrecs.  */
  
  static tree
! chrec_fold_plus_1 (enum tree_code code, 
! 		   tree type, 
! 		   tree op0,
! 		   tree op1)
  {
    if (automatically_generated_chrec_p (op0)
        || automatically_generated_chrec_p (op1))
--- 251,258 ----
  /* Fold the addition of two chrecs.  */
  
  static tree
! chrec_fold_plus_1 (enum tree_code code, tree type, 
! 		   tree op0, tree op1)
  {
    if (automatically_generated_chrec_p (op0)
        || automatically_generated_chrec_p (op1))
*************** chrec_fold_plus (tree type, 
*** 319,324 ****
--- 322,331 ----
  		 tree op0,
  		 tree op1)
  {
+   if (automatically_generated_chrec_p (op0)
+       || automatically_generated_chrec_p (op1))
+     return chrec_fold_automatically_generated_operands (op0, op1);
+ 
    if (integer_zerop (op0))
      return op1;
    if (integer_zerop (op1))
*************** chrec_fold_minus (tree type, 
*** 334,339 ****
--- 341,350 ----
  		  tree op0, 
  		  tree op1)
  {
+   if (automatically_generated_chrec_p (op0)
+       || automatically_generated_chrec_p (op1))
+     return chrec_fold_automatically_generated_operands (op0, op1);
+ 
    if (integer_zerop (op1))
      return op0;
    
*************** chrec_replace_initial_condition (tree ch
*** 583,589 ****
  {
    if (automatically_generated_chrec_p (chrec))
      return chrec;
!   
    switch (TREE_CODE (chrec))
      {
      case POLYNOMIAL_CHREC:
--- 594,602 ----
  {
    if (automatically_generated_chrec_p (chrec))
      return chrec;
! 
!   gcc_assert (chrec_type (chrec) == chrec_type (init_cond));
! 
    switch (TREE_CODE (chrec))
      {
      case POLYNOMIAL_CHREC:
*************** reset_evolution_in_loop (unsigned loop_n
*** 729,734 ****
--- 742,749 ----
  			 tree chrec, 
  			 tree new_evol)
  {
+   gcc_assert (chrec_type (chrec) == chrec_type (new_evol));
+ 
    if (TREE_CODE (chrec) == POLYNOMIAL_CHREC
        && CHREC_VARIABLE (chrec) > loop_num)
      {
*************** chrec_convert_aggressive (tree type, tre
*** 1241,1257 ****
    return build_polynomial_chrec (CHREC_VARIABLE (chrec), lc, rc);
  }
  
- /* Returns the type of the chrec.  */
- 
- tree 
- chrec_type (tree chrec)
- {
-   if (automatically_generated_chrec_p (chrec))
-     return NULL_TREE;
-   
-   return TREE_TYPE (chrec);
- }
- 
  /* Returns true when CHREC0 == CHREC1.  */
  
  bool 
--- 1256,1261 ----
*************** eq_evolutions_p (tree chrec0, 
*** 1269,1276 ****
    switch (TREE_CODE (chrec0))
      {
      case INTEGER_CST:
!       return integer_zerop (fold (build2 (MINUS_EXPR, TREE_TYPE (chrec0), 
! 					 chrec0, chrec1)));
      case POLYNOMIAL_CHREC:
        return (CHREC_VARIABLE (chrec0) == CHREC_VARIABLE (chrec1)
  	      && eq_evolutions_p (CHREC_LEFT (chrec0), CHREC_LEFT (chrec1))
--- 1273,1280 ----
    switch (TREE_CODE (chrec0))
      {
      case INTEGER_CST:
!       return operand_equal_p (chrec0, chrec1, 0);
! 
      case POLYNOMIAL_CHREC:
        return (CHREC_VARIABLE (chrec0) == CHREC_VARIABLE (chrec1)
  	      && eq_evolutions_p (CHREC_LEFT (chrec0), CHREC_LEFT (chrec1))
Index: tree-chrec.h
===================================================================
*** tree-chrec.h	(revision 112501)
--- tree-chrec.h	(working copy)
*************** extern tree chrec_fold_minus (tree, tree
*** 69,75 ****
  extern tree chrec_fold_multiply (tree, tree, tree);
  extern tree chrec_convert (tree, tree, tree);
  extern tree chrec_convert_aggressive (tree, tree);
- extern tree chrec_type (tree);
  
  /* Operations.  */
  extern tree chrec_apply (unsigned, tree, tree);
--- 69,74 ----
*************** build_polynomial_chrec (unsigned loop_nu
*** 106,111 ****
--- 105,112 ----
        || right == chrec_dont_know)
      return chrec_dont_know;
  
+   gcc_assert (TREE_TYPE (left) == TREE_TYPE (right));
+ 
    return build3 (POLYNOMIAL_CHREC, TREE_TYPE (left), 
  		 build_int_cst (NULL_TREE, loop_num), left, right);
  }
*************** no_evolution_in_loop_p (tree chrec, unsi
*** 208,211 ****
--- 209,224 ----
    return true;
  }
  
+ /* Returns the type of the chrec.  */
+ 
+ static inline tree
+ chrec_type (tree chrec)
+ {
+   if (automatically_generated_chrec_p (chrec))
+     return NULL_TREE;
+ 
+   return TREE_TYPE (chrec);
+ }
+ 
+ 
  #endif  /* GCC_TREE_CHREC_H  */
Index: tree-data-ref.c
===================================================================
*** tree-data-ref.c	(revision 112507)
--- tree-data-ref.c	(working copy)
*************** create_data_ref (tree memref, tree stmt,
*** 1930,1937 ****
  			       constant, type_size);
      }
    else
!     DR_INIT (dr) = init_cond = ssize_int (0);;
!   
    if (invariant)
      DR_OFFSET (dr) = invariant;
    else
--- 1930,1937 ----
  			       constant, type_size);
      }
    else
!     DR_INIT (dr) = init_cond = ssize_int (0);
! 
    if (invariant)
      DR_OFFSET (dr) = invariant;
    else
*************** create_data_ref (tree memref, tree stmt,
*** 1957,1962 ****
--- 1957,1964 ----
        new_step = size_binop (TRUNC_DIV_EXPR,  
  			     fold_convert (ssizetype, step), type_size);
  
+       init_cond = chrec_convert (chrec_type (access_fn), init_cond, stmt);
+       new_step = chrec_convert (chrec_type (access_fn), new_step, stmt);
        access_fn = chrec_replace_initial_condition (access_fn, init_cond);
        access_fn = reset_evolution_in_loop (loop->num, access_fn, new_step);
  
*************** all_chrecs_equal_p (tree chrec)
*** 2011,2024 ****
    int j;
  
    for (j = 0; j < TREE_VEC_LENGTH (chrec) - 1; j++)
!     {
!       tree chrec_j = TREE_VEC_ELT (chrec, j);
!       tree chrec_j_1 = TREE_VEC_ELT (chrec, j + 1);
!       if (!integer_zerop 
! 	  (chrec_fold_minus 
! 	   (integer_type_node, chrec_j, chrec_j_1)))
! 	return false;
!     }
    return true;
  }
  
--- 2013,2022 ----
    int j;
  
    for (j = 0; j < TREE_VEC_LENGTH (chrec) - 1; j++)
!     if (!eq_evolutions_p (TREE_VEC_ELT (chrec, j),
! 			  TREE_VEC_ELT (chrec, j + 1)))
!       return false;
! 
    return true;
  }
  
*************** compute_subscript_distance (struct data_
*** 2063,2068 ****
--- 2061,2070 ----
  		conflicts_b = TREE_VEC_ELT (conflicts_b, 0);
  	    }
  
+ 	  conflicts_b = chrec_convert (integer_type_node, conflicts_b,
+ 				       NULL_TREE);
+ 	  conflicts_a = chrec_convert (integer_type_node, conflicts_a,
+ 				       NULL_TREE);
  	  difference = chrec_fold_minus 
  	    (integer_type_node, conflicts_b, conflicts_a);
   	  
*************** analyze_ziv_subscript (tree chrec_a, 
*** 2250,2255 ****
--- 2252,2259 ----
    if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, "(analyze_ziv_subscript \n");
    
+   chrec_a = chrec_convert (integer_type_node, chrec_a, NULL_TREE);
+   chrec_b = chrec_convert (integer_type_node, chrec_b, NULL_TREE);
    difference = chrec_fold_minus (integer_type_node, chrec_a, chrec_b);
    
    switch (TREE_CODE (difference))
*************** analyze_siv_subscript_cst_affine (tree c
*** 2323,2329 ****
  				  tree *last_conflicts)
  {
    bool value0, value1, value2;
!   tree difference = chrec_fold_minus 
      (integer_type_node, CHREC_LEFT (chrec_b), chrec_a);
    
    if (!chrec_is_positive (initial_condition (difference), &value0))
--- 2327,2337 ----
  				  tree *last_conflicts)
  {
    bool value0, value1, value2;
!   tree difference;
! 
!   chrec_a = chrec_convert (integer_type_node, chrec_a, NULL_TREE);
!   chrec_b = chrec_convert (integer_type_node, chrec_b, NULL_TREE);
!   difference = chrec_fold_minus 
      (integer_type_node, CHREC_LEFT (chrec_b), chrec_a);
    
    if (!chrec_is_positive (initial_condition (difference), &value0))
*************** compute_overlap_steps_for_affine_1_2 (tr
*** 2641,2672 ****
        *overlaps_b = integer_zero_node;
        if (xz_p)
  	{
! 	  TREE_VEC_ELT (*overlaps_a, 0) = 
! 	    chrec_fold_plus (integer_type_node, TREE_VEC_ELT (*overlaps_a, 0),
! 			     overlaps_a_xz);
! 	  *overlaps_b = 
! 	    chrec_fold_plus (integer_type_node, *overlaps_b, overlaps_b_xz);
  	  *last_conflicts = last_conflicts_xz;
  	}
        if (yz_p)
  	{
! 	  TREE_VEC_ELT (*overlaps_a, 1) = 
! 	    chrec_fold_plus (integer_type_node, TREE_VEC_ELT (*overlaps_a, 1),
! 			     overlaps_a_yz);
! 	  *overlaps_b = 
! 	    chrec_fold_plus (integer_type_node, *overlaps_b, overlaps_b_yz);
  	  *last_conflicts = last_conflicts_yz;
  	}
        if (xyz_p)
  	{
! 	  TREE_VEC_ELT (*overlaps_a, 0) = 
! 	    chrec_fold_plus (integer_type_node, TREE_VEC_ELT (*overlaps_a, 0),
! 			     overlaps_a_xyz);
! 	  TREE_VEC_ELT (*overlaps_a, 1) = 
! 	    chrec_fold_plus (integer_type_node, TREE_VEC_ELT (*overlaps_a, 1),
! 			     overlaps_a_xyz);
! 	  *overlaps_b = 
! 	    chrec_fold_plus (integer_type_node, *overlaps_b, overlaps_b_xyz);
  	  *last_conflicts = last_conflicts_xyz;
  	}
      }
--- 2649,2700 ----
        *overlaps_b = integer_zero_node;
        if (xz_p)
  	{
! 	  tree t0 = chrec_convert (integer_type_node, 
! 				   TREE_VEC_ELT (*overlaps_a, 0), NULL_TREE);
! 	  tree t1 = chrec_convert (integer_type_node, overlaps_a_xz,
! 				   NULL_TREE);
! 	  tree t2 = chrec_convert (integer_type_node, *overlaps_b,
! 				   NULL_TREE);
! 	  tree t3 = chrec_convert (integer_type_node, overlaps_b_xz,
! 				   NULL_TREE);
! 
! 	  TREE_VEC_ELT (*overlaps_a, 0) = chrec_fold_plus (integer_type_node,
! 							   t0, t1);
! 	  *overlaps_b = chrec_fold_plus (integer_type_node, t2, t3);
  	  *last_conflicts = last_conflicts_xz;
  	}
        if (yz_p)
  	{
! 	  tree t0 = chrec_convert (integer_type_node,
! 				   TREE_VEC_ELT (*overlaps_a, 1), NULL_TREE);
! 	  tree t1 = chrec_convert (integer_type_node, overlaps_a_yz, NULL_TREE);
! 	  tree t2 = chrec_convert (integer_type_node, *overlaps_b, NULL_TREE);
! 	  tree t3 = chrec_convert (integer_type_node, overlaps_b_yz, NULL_TREE);
! 
! 	  TREE_VEC_ELT (*overlaps_a, 1) = chrec_fold_plus (integer_type_node,
! 							   t0, t1);
! 	  *overlaps_b = chrec_fold_plus (integer_type_node, t2, t3);
  	  *last_conflicts = last_conflicts_yz;
  	}
        if (xyz_p)
  	{
! 	  tree t0 = chrec_convert (integer_type_node,
! 				   TREE_VEC_ELT (*overlaps_a, 0), NULL_TREE);
! 	  tree t1 = chrec_convert (integer_type_node, overlaps_a_xyz,
! 				   NULL_TREE);
! 	  tree t2 = chrec_convert (integer_type_node,
! 				   TREE_VEC_ELT (*overlaps_a, 1), NULL_TREE);
! 	  tree t3 = chrec_convert (integer_type_node, overlaps_a_xyz,
! 				   NULL_TREE);
! 	  tree t4 = chrec_convert (integer_type_node, *overlaps_b, NULL_TREE);
! 	  tree t5 = chrec_convert (integer_type_node, overlaps_b_xyz,
! 				   NULL_TREE);
! 
! 	  TREE_VEC_ELT (*overlaps_a, 0) = chrec_fold_plus (integer_type_node,
! 							   t0, t1);
! 	  TREE_VEC_ELT (*overlaps_a, 1) = chrec_fold_plus (integer_type_node,
! 							   t2, t3);
! 	  *overlaps_b = chrec_fold_plus (integer_type_node, t4, t5);
  	  *last_conflicts = last_conflicts_xyz;
  	}
      }
*************** analyze_subscript_affine_affine (tree ch
*** 2694,2705 ****
    int init_a, init_b, gamma, gcd_alpha_beta;
    int tau1, tau2;
    lambda_matrix A, U, S;
-   tree difference = chrec_fold_minus (integer_type_node, chrec_a, chrec_b);
  
!   if (integer_zerop (difference))
      {
!       /* The difference is equal to zero: the accessed index
! 	 overlaps for each iteration in the loop.  */
        *overlaps_a = integer_zero_node;
        *overlaps_b = integer_zero_node;
        *last_conflicts = chrec_dont_know;
--- 2722,2732 ----
    int init_a, init_b, gamma, gcd_alpha_beta;
    int tau1, tau2;
    lambda_matrix A, U, S;
  
!   if (eq_evolutions_p (chrec_a, chrec_b))
      {
!       /* The accessed index overlaps for each iteration in the
! 	 loop.  */
        *overlaps_a = integer_zero_node;
        *overlaps_b = integer_zero_node;
        *last_conflicts = chrec_dont_know;
*************** analyze_subscript_affine_affine (tree ch
*** 2719,2725 ****
       there is no dependence.  This function outputs a description of
       the iterations that hold the intersections.  */
  
-   
    nb_vars_a = nb_vars_in_chrec (chrec_a);
    nb_vars_b = nb_vars_in_chrec (chrec_b);
  
--- 2746,2751 ----
*************** analyze_miv_subscript (tree chrec_a, 
*** 3177,3186 ****
    dependence_stats.num_miv++;
    if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, "(analyze_miv_subscript \n");
!   
    difference = chrec_fold_minus (integer_type_node, chrec_a, chrec_b);
    
!   if (chrec_zerop (difference))
      {
        /* Access functions are the same: all the elements are accessed
  	 in the same order.  */
--- 3203,3214 ----
    dependence_stats.num_miv++;
    if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, "(analyze_miv_subscript \n");
! 
!   chrec_a = chrec_convert (integer_type_node, chrec_a, NULL_TREE);
!   chrec_b = chrec_convert (integer_type_node, chrec_b, NULL_TREE);
    difference = chrec_fold_minus (integer_type_node, chrec_a, chrec_b);
    
!   if (eq_evolutions_p (chrec_a, chrec_b))
      {
        /* Access functions are the same: all the elements are accessed
  	 in the same order.  */
*************** same_access_functions (struct data_depen
*** 3502,3516 ****
    unsigned i;
  
    for (i = 0; i < DDR_NUM_SUBSCRIPTS (ddr); i++)
!     {
!       tree access_fun_a = DR_ACCESS_FN (DDR_A (ddr), i);
!       tree access_fun_b = DR_ACCESS_FN (DDR_B (ddr), i);
!       tree difference = chrec_fold_minus (integer_type_node, access_fun_a,
! 					  access_fun_b);
!       if (TREE_CODE (difference) != INTEGER_CST
! 	  || !integer_zerop (difference))
! 	return false;
!     }
  
    return true;
  }
--- 3530,3538 ----
    unsigned i;
  
    for (i = 0; i < DDR_NUM_SUBSCRIPTS (ddr); i++)
!     if (!eq_evolutions_p (DR_ACCESS_FN (DDR_A (ddr), i),
! 			  DR_ACCESS_FN (DDR_B (ddr), i)))
!       return false;
  
    return true;
  }

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