[lno] Remove EXPONENTIAL_CHREC nodes

Sebastian Pop sebastian.pop@cri.ensmp.fr
Wed Jun 9 20:42:00 GMT 2004


Hi, 

This patch removes the EXPONENTIAL_CHREC nodes, avoiding bloating the
code of the analyzer with unusual cases.  Bootstrapped on
amd64-unknown-freebsd5.2.  Could someone commit the patch for me on
the LNO branch, please?

If needed, the INTERVAL_CHREC and PEELED_CHREC nodes can be removed in
the same way, for the same reason.  I think that these nodes are more
interesting to handle than the EXPONENTIAL_CHREC.  

Here are the remaining tree nodes that are new in the LNO branch:

/* Intervals.
   Under the form: cr = [CHREC_LOW (cr), CHREC_UP (cr)].  
   CHREC_LOW and CHREC_UP contain INTEGER_CST nodes.  */
DEFTREECODE (INTERVAL_CHREC, "interval_chrec", 'e', 2)

/* Polynomial chains of recurrences.
   Under the form: cr = {CHREC_LEFT (cr), +, CHREC_RIGHT (cr)}.  */
DEFTREECODE (POLYNOMIAL_CHREC, "polynomial_chrec", 'e', 3)

/* Peeled chains of recurrences.
   Under the form: (CHREC_LEFT (cr), CHREC_RIGHT (cr)).  */
DEFTREECODE (PEELED_CHREC, "peeled_chrec", 'e', 3)


Index: ChangeLog.lno
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/ChangeLog.lno,v
retrieving revision 1.1.2.179
diff -c -3 -p -r1.1.2.179 ChangeLog.lno
*** ChangeLog.lno	9 Jun 2004 15:54:01 -0000	1.1.2.179
--- ChangeLog.lno	9 Jun 2004 18:32:54 -0000
***************
*** 1,3 ****
--- 1,46 ----
+ 2004-06-09  Sebastian Pop  <pop@cri.ensmp.fr>
+ 
+ 	* tree.def: Remove EXPONENTIAL_CHREC node.
+ 	* tree-chrec.c (is_not_constant_evolution, chrec_fold_plus_1,
+ 	chrec_fold_multiply, chrec_evaluate, chrec_apply, 
+ 	chrec_replace_initial_condition, initial_condition,
+ 	hide_evolution_in_loop, hide_evolution_in_other_loops_than_loop, 
+ 	evolution_part_in_loop_num, reset_evolution_in_loop,
+ 	reset_evolution_in_loop, chrec_merge, is_multivariate_chrec_rec, 
+ 	is_multivariate_chrec, evolution_function_is_affine_multivariate_p, 
+ 	evolution_function_is_univariate_p, chrec_convert): Don't
+ 	handle EXPONENTIAL_CHREC nodes.
+ 	(chrec_fold_plus_expo_cst, chrec_fold_plus_cst_expo, 
+ 	chrec_fold_plus_poly_expo, chrec_fold_plus_expo_poly, 
+ 	chrec_fold_plus_expo_expo, chrec_fold_multiply_poly_expo, 
+ 	chrec_fold_multiply_expo_expo, is_pure_sum_chrec): Removed.
+ 	* tree-chrec.h (tree_is_chrec, evolution_function_is_affine_p): 
+ 	Don't handle EXPONENTIAL_CHREC nodes.
+ 	(build_exponential_chrec): Removed.
+ 	(no_evolution_in_loop_p): Use a call to tree_is_chrec for
+ 	determining when a node represents a scalar evolution.
+ 	* tree-data-ref.c (siv_subscript_p): Don't handle
+ 	EXPONENTIAL_CHREC nodes.
+ 	* tree-pretty-print.c (dump_generic_node): Same.
+ 	* tree-scalar-evolution.c: Remove FIXME comments about
+ 	EXPONENTIAL_CHREC nodes.  Add a pointer to the slides
+ 	presented at the GCC Summit 2004 about the scalar evolutions.
+ 	(compute_overall_effect_of_inner_loop): Clarify the leading comment.
+ 	(chrec_is_positive, add_to_evolution_1, add_to_evolution, 
+ 	instantiate_parameters_1): Don't handle EXPONENTIAL_CHREC nodes.
+ 	(multiply_evolution_1, multiply_evolution): Removed.
+ 	(first_iteration_non_satisfying_ev_ev): Handle only affine
+ 	functions.
+ 	(follow_ssa_edge_in_rhs): Cases that were detected as
+ 	EXPONENTIAL_CHREC nodes are now mapped to the unknown element
+ 	(be it top or bottom) called chrec_top.
+ 	(chrec_stats, reset_chrecs_counters, dump_chrecs_stats,
+ 	gather_chrec_stats): Don't count the EXPONENTIAL_CHREC nodes.
+ 	* tree-vectorizer.c (vect_is_simple_iv_evolution,
+ 	vect_analyze_loop_with_symbolic_num_of_iters): Use
+ 	tree_is_chrec for determining whether the given node has an
+ 	evolution.
+ 
  2004-06-09  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
  
  	* ra-build.c (livethrough_conflicts_bb): Check also contains_call.
Index: tree-chrec.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-chrec.c,v
retrieving revision 1.1.2.23
diff -c -3 -p -r1.1.2.23 tree-chrec.c
*** tree-chrec.c	29 May 2004 22:09:02 -0000	1.1.2.23
--- tree-chrec.c	9 Jun 2004 17:57:37 -0000
***************
*** 1,5 ****
  /* Chains of recurrences.
!    Copyright (C) 2003 Free Software Foundation, Inc.
     Contributed by Sebastian Pop <s.pop@laposte.net>
  
  This file is part of GCC.
--- 1,5 ----
  /* Chains of recurrences.
!    Copyright (C) 2003, 2004 Free Software Foundation, Inc.
     Contributed by Sebastian Pop <s.pop@laposte.net>
  
  This file is part of GCC.
*************** static inline bool
*** 45,51 ****
  is_not_constant_evolution (tree cst)
  {
    return (TREE_CODE (cst) == POLYNOMIAL_CHREC
- 	  || TREE_CODE (cst) == EXPONENTIAL_CHREC
  	  || TREE_CODE (cst) == PEELED_CHREC);
  }
  
--- 45,50 ----
*************** chrec_fold_plus_peel_cst (tree type, 
*** 111,156 ****
       chrec_fold_plus (type, CHREC_RIGHT (peel), cst));
  }
  
- /* Fold the addition of an exponential function and a constant.  */
- 
- static inline tree 
- chrec_fold_plus_expo_cst (enum tree_code code, 
- 			  tree type, 
- 			  tree expo, 
- 			  tree cst)
- {
- #if defined ENABLE_CHECKING
-   if (expo == NULL_TREE
-       || cst == NULL_TREE
-       || TREE_CODE (expo) != EXPONENTIAL_CHREC
-       || is_not_constant_evolution (cst))
-     abort ();
- #endif
-   
-   /* For the moment, we don't know how to fold this further.  */
-   return build (code, type, expo, cst);
- }
- 
- /* Fold the addition of an exponential function and a constant.  */
- 
- static inline tree 
- chrec_fold_plus_cst_expo (enum tree_code code, 
- 			  tree type, 
- 			  tree cst, 
- 			  tree expo)
- {
- #if defined ENABLE_CHECKING
-   if (expo == NULL_TREE
-       || cst == NULL_TREE
-       || TREE_CODE (expo) != EXPONENTIAL_CHREC
-       || is_not_constant_evolution (cst))
-     abort ();
- #endif
-   
-   /* For the moment, we don't know how to fold this further.  */
-   return build (code, type, cst, expo);
- }
- 
  /* Fold the addition of two polynomial functions.  */
  
  static inline tree 
--- 110,115 ----
*************** chrec_fold_plus_peel_poly (enum tree_cod
*** 324,369 ****
        chrec_fold_minus (type, CHREC_RIGHT (peel), poly)));
  }
  
- /* Fold the addition of a polynomial and an exponential functions.  */
- 
- static inline tree 
- chrec_fold_plus_poly_expo (enum tree_code code, 
- 			   tree type, 
- 			   tree poly, 
- 			   tree expo)
- {
- #if defined ENABLE_CHECKING
-   if (expo == NULL_TREE
-       || poly == NULL_TREE
-       || TREE_CODE (expo) != EXPONENTIAL_CHREC
-       || TREE_CODE (poly) != POLYNOMIAL_CHREC)
-     abort ();
- #endif
-   
-   /* For the moment, we don't know how to fold this further.  */
-   return build (code, type, poly, expo);
- }
- 
- /* Fold the addition of a polynomial and an exponential functions.  */
- 
- static inline tree 
- chrec_fold_plus_expo_poly (enum tree_code code, 
- 			   tree type, 
- 			   tree expo, 
- 			   tree poly)
- {
- #if defined ENABLE_CHECKING
-   if (expo == NULL_TREE
-       || poly == NULL_TREE
-       || TREE_CODE (expo) != EXPONENTIAL_CHREC
-       || TREE_CODE (poly) != POLYNOMIAL_CHREC)
-     abort ();
- #endif
-   
-   /* For the moment, we don't know how to fold this further.  */
-   return build (code, type, expo, poly);
- }
- 
  /* Fold the addition of two peeled chrecs.  */
  
  static inline tree 
--- 283,288 ----
*************** chrec_fold_plus_peel_peel (tree type, 
*** 401,426 ****
       chrec_fold_plus (type, CHREC_RIGHT (peel0), CHREC_RIGHT (peel1)));
  }
  
- /* Fold the addition of two exponential functions.  */
- 
- static inline tree 
- chrec_fold_plus_expo_expo (enum tree_code code, 
- 			   tree type, 
- 			   tree expo0, 
- 			   tree expo1)
- {
- #if defined ENABLE_CHECKING
-   if (expo0 == NULL_TREE
-       || expo1 == NULL_TREE
-       || TREE_CODE (expo0) != EXPONENTIAL_CHREC
-       || TREE_CODE (expo1) != EXPONENTIAL_CHREC)
-     abort ();
- #endif
-   
-   /* For the moment, we don't know how to fold this further.  */
-   return build (code, type, expo0, expo1);
- }
- 
  
  
  /* Fold the multiplication of a peeled chrec and a constant.  */
--- 320,325 ----
*************** chrec_fold_multiply_poly_peel (tree type
*** 577,602 ****
       chrec_fold_multiply (type, poly, CHREC_RIGHT (peel)));
  }
  
- /* Fold the multiplication of a polynomial and an exponential
-    functions.  */
- 
- static inline tree 
- chrec_fold_multiply_poly_expo (tree type, 
- 			       tree poly, 
- 			       tree expo)
- {
- #if defined ENABLE_CHECKING
-   if (expo == NULL_TREE
-       || poly == NULL_TREE
-       || TREE_CODE (expo) != EXPONENTIAL_CHREC
-       || TREE_CODE (poly) != POLYNOMIAL_CHREC)
-     abort ();
- #endif
-   
-   /* For the moment, we don't know how to fold this further.  */
-   return build (MULT_EXPR, type, expo, poly);
- }
- 
  /* Fold the addition of two peeled chrecs.  */
  
  static inline tree 
--- 476,481 ----
*************** chrec_fold_multiply_peel_peel (tree type
*** 634,674 ****
       chrec_fold_multiply (type, CHREC_RIGHT (peel0), CHREC_RIGHT (peel1)));
  }
  
- /* Fold the multiplication of two exponential functions.  */
- 
- static inline tree 
- chrec_fold_multiply_expo_expo (tree type, 
- 			       tree expo0, 
- 			       tree expo1)
- {
- #if defined ENABLE_CHECKING
-   if (expo0 == NULL_TREE
-       || expo1 == NULL_TREE
-       || TREE_CODE (expo0) != EXPONENTIAL_CHREC
-       || TREE_CODE (expo1) != EXPONENTIAL_CHREC)
-     abort ();
- #endif
-   
-   if (CHREC_VARIABLE (expo0) < CHREC_VARIABLE (expo1))
-     /* expo0 is a constant wrt. expo1.  */
-     return build_exponential_chrec 
-       (CHREC_VARIABLE (expo1), 
-        chrec_fold_multiply (type, CHREC_LEFT (expo1), expo0),
-        CHREC_RIGHT (expo1));
-   
-   if (CHREC_VARIABLE (expo1) < CHREC_VARIABLE (expo0))
-     /* expo1 is a constant wrt. expo0.  */
-     return build_exponential_chrec
-       (CHREC_VARIABLE (expo0), 
-        chrec_fold_multiply (type, CHREC_LEFT (expo0), expo1),
-        CHREC_RIGHT (expo0));
-   
-   return build_exponential_chrec 
-     (CHREC_VARIABLE (expo0), 
-      chrec_fold_multiply (type, CHREC_LEFT (expo0), CHREC_LEFT (expo1)),
-      chrec_fold_multiply (type, CHREC_RIGHT (expo0), CHREC_RIGHT (expo1)));
- }
- 
  /* Fold the multiplication of two intervals.  */
  
  static inline tree
--- 513,518 ----
*************** chrec_fold_plus_1 (enum tree_code code, 
*** 770,778 ****
  	case POLYNOMIAL_CHREC:
  	  return chrec_fold_plus_poly_poly (code, type, op0, op1);
  	  
- 	case EXPONENTIAL_CHREC:
- 	  return chrec_fold_plus_poly_expo (code, type, op0, op1);
- 	  
  	case PEELED_CHREC:
  	  return chrec_fold_plus_poly_peel (code, type, op0, op1);
  	  
--- 614,619 ----
*************** chrec_fold_plus_1 (enum tree_code code, 
*** 789,810 ****
  	       CHREC_RIGHT (op0));
  	}
        
-     case EXPONENTIAL_CHREC:
-       switch (TREE_CODE (op1))
- 	{
- 	case POLYNOMIAL_CHREC:
- 	  return chrec_fold_plus_expo_poly (code, type, op0, op1);
- 	  
- 	case EXPONENTIAL_CHREC:
- 	  return chrec_fold_plus_expo_expo (code, type, op0, op1);
- 	  
- 	case PEELED_CHREC:
- 	  return build (code, type, op0, op1);
- 
- 	default:
- 	  return chrec_fold_plus_expo_cst (code, type, op0, op1);
- 	}
-       
      case PEELED_CHREC:
        switch (TREE_CODE (op1))
  	{
--- 630,635 ----
*************** chrec_fold_plus_1 (enum tree_code code, 
*** 814,822 ****
  	case PEELED_CHREC:
  	  return chrec_fold_plus_peel_peel (type, op0, op1);
  	  
- 	case EXPONENTIAL_CHREC:
- 	  return build (code, type, op0, op1);
- 	  
  	default:
  	  return build_peeled_chrec 
  	    (CHREC_VARIABLE (op0),
--- 639,644 ----
*************** chrec_fold_plus_1 (enum tree_code code, 
*** 839,847 ****
  	      chrec_fold_minus (type, op0, CHREC_LEFT (op1))),
  	     CHREC_RIGHT (op1));
  	  
- 	case EXPONENTIAL_CHREC:
- 	  return chrec_top;
- 	  
  	case INTERVAL_CHREC:
  	  t1 = (code == PLUS_EXPR ? 
  		chrec_fold_plus (type, CHREC_LOW (op0), CHREC_LOW (op1)) :
--- 661,666 ----
*************** chrec_fold_plus_1 (enum tree_code code, 
*** 899,908 ****
  	       chrec_fold_multiply (type, CHREC_RIGHT (op1), 
  				    convert (type,
  					     integer_minus_one_node)));
! 	     
! 	case EXPONENTIAL_CHREC:
! 	  return chrec_fold_plus_cst_expo (code, type, op0, op1);
! 	  
  	case PEELED_CHREC:
  	  if (code == PLUS_EXPR)
  	    return build_peeled_chrec 
--- 718,724 ----
  	       chrec_fold_multiply (type, CHREC_RIGHT (op1), 
  				    convert (type,
  					     integer_minus_one_node)));
! 
  	case PEELED_CHREC:
  	  if (code == PLUS_EXPR)
  	    return build_peeled_chrec 
*************** chrec_fold_multiply (tree type, 
*** 1004,1012 ****
  	case PEELED_CHREC:
  	  return chrec_fold_multiply_poly_peel (type, op0, op1);
  	  
- 	case EXPONENTIAL_CHREC:
- 	  return chrec_fold_multiply_poly_expo (type, op0, op1);
- 	  
  	default:
  	  if (integer_onep (op1))
  	    return op0;
--- 820,825 ----
*************** chrec_fold_multiply (tree type, 
*** 1040,1066 ****
  	     chrec_fold_multiply (type, CHREC_RIGHT (op0), op1));
  	}
        
-     case EXPONENTIAL_CHREC:
-       switch (TREE_CODE (op1))
- 	{
- 	case POLYNOMIAL_CHREC:
- 	  return chrec_fold_multiply_poly_expo (type, op1, op0);
- 	  
- 	case EXPONENTIAL_CHREC:
- 	  return chrec_fold_multiply_expo_expo (type, op0, op1);
- 	  
- 	default:
- 	  if (integer_onep (op1))
- 	    return op0;
- 	  if (integer_zerop (op1))
- 	    return convert (type, integer_zero_node);
- 	  
- 	  return build_exponential_chrec 
- 	    (CHREC_VARIABLE (op0),
- 	     chrec_fold_multiply (type, CHREC_LEFT (op0), op1),
- 	     CHREC_RIGHT (op0));
- 	}
-       
      case INTERVAL_CHREC:
        switch (TREE_CODE (op1))
  	{
--- 853,858 ----
*************** chrec_fold_multiply (tree type, 
*** 1076,1087 ****
  	     chrec_fold_multiply (type, CHREC_LEFT (op1), op0),
  	     chrec_fold_multiply (type, CHREC_RIGHT (op1), op0));
  	  
- 	case EXPONENTIAL_CHREC:
- 	  return build_exponential_chrec 
- 	    (CHREC_VARIABLE (op1),
- 	     chrec_fold_multiply (type, CHREC_LEFT (op1), op0),
- 	     CHREC_RIGHT (op1));
- 	  
  	case INTERVAL_CHREC:
  	  return chrec_fold_multiply_ival_ival (type, op0, op1);
  	  
--- 868,873 ----
*************** chrec_fold_multiply (tree type, 
*** 1114,1125 ****
  	     chrec_fold_multiply (type, CHREC_LEFT (op1), op0),
  	     chrec_fold_multiply (type, CHREC_RIGHT (op1), op0));
  	  
- 	case EXPONENTIAL_CHREC:
- 	  return build_exponential_chrec 
- 	    (CHREC_VARIABLE (op1),
- 	     chrec_fold_multiply (type, CHREC_LEFT (op1), op0),
- 	     CHREC_RIGHT (op1));
- 	  
  	case INTERVAL_CHREC:
  	  return chrec_fold_multiply_ival_cst (type, op1, op0);
  	  
--- 900,905 ----
*************** chrec_evaluate (unsigned var,
*** 1161,1170 ****
    tree type = chrec_type (chrec);
    tree binomial_n_k = tree_fold_binomial (n, k);
    
-   if (TREE_CODE (chrec) == EXPONENTIAL_CHREC
-       && CHREC_VARIABLE (chrec) == var)
-     return chrec_top;
-   
    if (TREE_CODE (chrec) == POLYNOMIAL_CHREC)
      {
        if (CHREC_VARIABLE (chrec) > var)
--- 941,946 ----
*************** chrec_apply (unsigned var,
*** 1228,1235 ****
  						    CHREC_RIGHT (chrec), x));
      }
    
!   else if (TREE_CODE (chrec) != POLYNOMIAL_CHREC
! 	   && TREE_CODE (chrec) != EXPONENTIAL_CHREC)
      res = chrec;
    
    else if (TREE_CODE (x) == INTEGER_CST
--- 1004,1010 ----
  						    CHREC_RIGHT (chrec), x));
      }
    
!   else if (TREE_CODE (chrec) != POLYNOMIAL_CHREC)
      res = chrec;
    
    else if (TREE_CODE (x) == INTEGER_CST
*************** chrec_replace_initial_condition (tree ch
*** 1272,1283 ****
  	 chrec_replace_initial_condition (CHREC_LEFT (chrec), init_cond),
  	 CHREC_RIGHT (chrec));
        
-     case EXPONENTIAL_CHREC:
-       return build_exponential_chrec
- 	(CHREC_VARIABLE (chrec),
- 	 chrec_replace_initial_condition (CHREC_LEFT (chrec), init_cond),
- 	 CHREC_RIGHT (chrec));
-       
      case PEELED_CHREC:
        return chrec_top;
        
--- 1047,1052 ----
*************** initial_condition (tree chrec)
*** 1294,1301 ****
    if (automatically_generated_chrec_p (chrec))
      return chrec;
    
!   if (TREE_CODE (chrec) == POLYNOMIAL_CHREC
!       || TREE_CODE (chrec) == EXPONENTIAL_CHREC)
      return initial_condition (CHREC_LEFT (chrec));
    else
      return chrec;
--- 1063,1069 ----
    if (automatically_generated_chrec_p (chrec))
      return chrec;
    
!   if (TREE_CODE (chrec) == POLYNOMIAL_CHREC)
      return initial_condition (CHREC_LEFT (chrec));
    else
      return chrec;
*************** hide_evolution_in_loop (tree chrec, unsi
*** 1322,1337 ****
  	   hide_evolution_in_loop (CHREC_LEFT (chrec), loop_num), 
  	   CHREC_RIGHT (chrec));
  
-     case EXPONENTIAL_CHREC:
-       if (CHREC_VARIABLE (chrec) >= loop_num)
- 	return hide_evolution_in_loop (CHREC_LEFT (chrec), loop_num);
- 
-       else
- 	return build_exponential_chrec 
- 	  (CHREC_VARIABLE (chrec),
- 	   hide_evolution_in_loop (CHREC_LEFT (chrec), loop_num),
- 	   CHREC_RIGHT (chrec));
- 
      default:
        return chrec;
      }
--- 1090,1095 ----
*************** hide_evolution_in_other_loops_than_loop 
*** 1365,1386 ****
  	return hide_evolution_in_other_loops_than_loop (CHREC_LEFT (chrec), 
  							loop_num);
        
-     case EXPONENTIAL_CHREC:
-       if (CHREC_VARIABLE (chrec) == loop_num)
- 	return build_exponential_chrec 
- 	  (loop_num,
- 	   hide_evolution_in_other_loops_than_loop (CHREC_LEFT (chrec), 
- 						    loop_num),
- 	   CHREC_RIGHT (chrec));
-       
-       else if (CHREC_VARIABLE (chrec) < loop_num)
- 	/* There is no evolution in this loop.  */
- 	return initial_condition (chrec);
-       
-       else
- 	return hide_evolution_in_other_loops_than_loop (CHREC_LEFT (chrec), 
- 							loop_num);
-       
      default:
        return chrec;
      }
--- 1123,1128 ----
*************** evolution_part_in_loop_num (tree chrec, 
*** 1420,1446 ****
        else
  	return evolution_part_in_loop_num (CHREC_LEFT (chrec), loop_num);
        
-     case EXPONENTIAL_CHREC:
-       if (CHREC_VARIABLE (chrec) == loop_num)
- 	{
- 	  if (TREE_CODE (CHREC_LEFT (chrec)) != EXPONENTIAL_CHREC
- 	      || CHREC_VARIABLE (CHREC_LEFT (chrec)) != CHREC_VARIABLE (chrec))
- 	    return CHREC_RIGHT (chrec);
- 	  
- 	  else
- 	    return build_exponential_chrec 
- 	      (loop_num,
- 	       evolution_part_in_loop_num (CHREC_LEFT (chrec), loop_num),
- 	       CHREC_RIGHT (chrec));
- 	}
-       
-       else if (CHREC_VARIABLE (chrec) < loop_num)
- 	/* There is no evolution part in this loop.  */
- 	return NULL_TREE;
-       
-       else
- 	return evolution_part_in_loop_num (CHREC_LEFT (chrec), loop_num);
-       
      default:
        return NULL_TREE;
      }
--- 1162,1167 ----
*************** reset_evolution_in_loop (unsigned loop_n
*** 1456,1463 ****
  			 tree chrec, 
  			 tree new_evol)
  {
!   if ((TREE_CODE (chrec) == POLYNOMIAL_CHREC
!        || TREE_CODE (chrec) == EXPONENTIAL_CHREC)
        && CHREC_VARIABLE (chrec) > loop_num)
      return build 
        (TREE_CODE (chrec), 
--- 1177,1183 ----
  			 tree chrec, 
  			 tree new_evol)
  {
!   if (TREE_CODE (chrec) == POLYNOMIAL_CHREC
        && CHREC_VARIABLE (chrec) > loop_num)
      return build 
        (TREE_CODE (chrec), 
*************** reset_evolution_in_loop (unsigned loop_n
*** 1465,1472 ****
         reset_evolution_in_loop (loop_num, CHREC_LEFT (chrec), new_evol), 
         reset_evolution_in_loop (loop_num, CHREC_RIGHT (chrec), new_evol));
    
!   while ((TREE_CODE (chrec) == POLYNOMIAL_CHREC
! 	  || TREE_CODE (chrec) == EXPONENTIAL_CHREC)
  	 && CHREC_VARIABLE (chrec) == loop_num)
      chrec = CHREC_LEFT (chrec);
    
--- 1185,1191 ----
         reset_evolution_in_loop (loop_num, CHREC_LEFT (chrec), new_evol), 
         reset_evolution_in_loop (loop_num, CHREC_RIGHT (chrec), new_evol));
    
!   while (TREE_CODE (chrec) == POLYNOMIAL_CHREC
  	 && CHREC_VARIABLE (chrec) == loop_num)
      chrec = CHREC_LEFT (chrec);
    
*************** chrec_merge (tree chrec1, 
*** 1568,1580 ****
  	     chrec_merge (convert (type, integer_zero_node),
  			  CHREC_RIGHT (chrec2)));
  	  
- 	case EXPONENTIAL_CHREC:
- 	  return build_exponential_chrec 
- 	    (CHREC_VARIABLE (chrec2),
- 	     chrec_merge (chrec1, CHREC_LEFT (chrec2)),
- 	     chrec_merge (convert (type, integer_one_node),
- 			  CHREC_RIGHT (chrec2)));
- 
  	default:
  	  return chrec_top;
  	}
--- 1287,1292 ----
*************** chrec_merge (tree chrec1, 
*** 1609,1624 ****
  	       chrec_merge (CHREC_RIGHT (chrec1),
  			    convert (type, integer_zero_node)));
  	  
- 	case EXPONENTIAL_CHREC:
- 	  return chrec_top;
- 	  
  	default:
  	  return chrec_top;
  	}
        
-     case EXPONENTIAL_CHREC:
-       return chrec_top;
- 
      default:
        return chrec_top;
      }
--- 1321,1330 ----
*************** is_multivariate_chrec_rec (tree chrec, u
*** 1636,1643 ****
    if (chrec == NULL_TREE)
      return false;
    
!   if (TREE_CODE (chrec) == POLYNOMIAL_CHREC
!       || TREE_CODE (chrec) == EXPONENTIAL_CHREC)
      {
        if (CHREC_VARIABLE (chrec) != rec_var)
  	return true;
--- 1342,1348 ----
    if (chrec == NULL_TREE)
      return false;
    
!   if (TREE_CODE (chrec) == POLYNOMIAL_CHREC)
      {
        if (CHREC_VARIABLE (chrec) != rec_var)
  	return true;
*************** is_multivariate_chrec (tree chrec)
*** 1657,1664 ****
    if (chrec == NULL_TREE)
      return false;
    
!   if (TREE_CODE (chrec) == POLYNOMIAL_CHREC
!       || TREE_CODE (chrec) == EXPONENTIAL_CHREC)
      return (is_multivariate_chrec_rec (CHREC_LEFT (chrec), 
  				       CHREC_VARIABLE (chrec))
  	    || is_multivariate_chrec_rec (CHREC_RIGHT (chrec), 
--- 1362,1368 ----
    if (chrec == NULL_TREE)
      return false;
    
!   if (TREE_CODE (chrec) == POLYNOMIAL_CHREC)
      return (is_multivariate_chrec_rec (CHREC_LEFT (chrec), 
  				       CHREC_VARIABLE (chrec))
  	    || is_multivariate_chrec_rec (CHREC_RIGHT (chrec), 
*************** is_multivariate_chrec (tree chrec)
*** 1667,1690 ****
      return false;
  }
  
- /* Determine whether the given chrec is a polynomial or not.  */
- 
- bool
- is_pure_sum_chrec (tree chrec)
- {
-   if (chrec == NULL_TREE)
-     return true;
-   
-   if (TREE_CODE (chrec) == EXPONENTIAL_CHREC)
-     return false;
-   
-   if (TREE_CODE (chrec) == POLYNOMIAL_CHREC)
-     return (is_pure_sum_chrec (CHREC_LEFT (chrec))
- 	    && is_pure_sum_chrec (CHREC_RIGHT (chrec)));
-   
-   return true;
- }
- 
  /* Determines whether the chrec contains symbolic names or not.  */
  
  bool 
--- 1371,1376 ----
*************** evolution_function_is_affine_multivariat
*** 1850,1857 ****
  	    return false;
  	}
        
-       
-     case EXPONENTIAL_CHREC:
      case INTERVAL_CHREC:
      default:
        return false;
--- 1536,1541 ----
*************** evolution_function_is_univariate_p (tree
*** 1870,1880 ****
    switch (TREE_CODE (chrec))
      {
      case POLYNOMIAL_CHREC:
-     case EXPONENTIAL_CHREC:
        switch (TREE_CODE (CHREC_LEFT (chrec)))
  	{
  	case POLYNOMIAL_CHREC:
- 	case EXPONENTIAL_CHREC:
  	  if (CHREC_VARIABLE (chrec) != CHREC_VARIABLE (CHREC_LEFT (chrec)))
  	    return false;
  	  if (!evolution_function_is_univariate_p (CHREC_LEFT (chrec)))
--- 1554,1562 ----
*************** evolution_function_is_univariate_p (tree
*** 1888,1894 ****
        switch (TREE_CODE (CHREC_RIGHT (chrec)))
  	{
  	case POLYNOMIAL_CHREC:
- 	case EXPONENTIAL_CHREC:
  	  if (CHREC_VARIABLE (chrec) != CHREC_VARIABLE (CHREC_RIGHT (chrec)))
  	    return false;
  	  if (!evolution_function_is_univariate_p (CHREC_RIGHT (chrec)))
--- 1570,1575 ----
*************** chrec_convert (tree type, 
*** 1933,1945 ****
  				     chrec_convert (type,
  						    CHREC_RIGHT (chrec)));
  
-     case EXPONENTIAL_CHREC:
-       return build_exponential_chrec (CHREC_VARIABLE (chrec),
- 				      chrec_convert (type,
- 						     CHREC_LEFT (chrec)),
- 				      chrec_convert (type,
- 						     CHREC_RIGHT (chrec)));
-       
      case PEELED_CHREC:
        return build_peeled_chrec 
  	(CHREC_VARIABLE (chrec), 
--- 1614,1619 ----
Index: tree-chrec.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-chrec.h,v
retrieving revision 1.1.2.20
diff -c -3 -p -r1.1.2.20 tree-chrec.h
*** tree-chrec.h	12 May 2004 10:10:19 -0000	1.1.2.20
--- tree-chrec.h	9 Jun 2004 17:57:37 -0000
***************
*** 1,5 ****
  /* Chains of recurrences.
!    Copyright (C) 2003 Free Software Foundation, Inc.
     Contributed by Sebastian Pop <s.pop@laposte.net>
  
  This file is part of GCC.
--- 1,5 ----
  /* Chains of recurrences.
!    Copyright (C) 2003, 2004 Free Software Foundation, Inc.
     Contributed by Sebastian Pop <s.pop@laposte.net>
  
  This file is part of GCC.
*************** tree_is_chrec (tree expr)
*** 58,64 ****
  {
    if (TREE_CODE (expr) == INTERVAL_CHREC
        || TREE_CODE (expr) == POLYNOMIAL_CHREC
-       || TREE_CODE (expr) == EXPONENTIAL_CHREC
        || TREE_CODE (expr) == PEELED_CHREC)
      return true;
    else
--- 58,63 ----
*************** extern tree chrec_fold_automatically_gen
*** 90,96 ****
  
  /* Observers.  */
  extern bool is_multivariate_chrec (tree);
- extern bool is_pure_sum_chrec (tree);
  extern bool chrec_is_positive (tree, bool *);
  extern bool chrec_contains_symbols (tree);
  extern bool chrec_contains_symbols_defined_in_loop (tree, unsigned);
--- 89,94 ----
*************** build_polynomial_chrec (unsigned loop_nu
*** 131,147 ****
  		build_int_2 (loop_num, 0), left, right);
  }
  
- /* Build an exponential chain of recurrence.  */
- 
- static inline tree 
- build_exponential_chrec (unsigned loop_num, 
- 			 tree left, 
- 			 tree right)
- {
-   return build (EXPONENTIAL_CHREC, TREE_TYPE (left), 
- 		build_int_2 (loop_num, 0), left, right);
- }
- 
  /* Build a peeled chain of recurrence.  */
  
  static inline tree 
--- 129,134 ----
*************** evolution_function_is_affine_p (tree chr
*** 238,244 ****
        else
  	return false;
        
-     case EXPONENTIAL_CHREC:
      case INTERVAL_CHREC:
      default:
        return false;
--- 225,230 ----
*************** no_evolution_in_loop_p (tree chrec, unsi
*** 313,320 ****
      return false;
  
    scev = hide_evolution_in_other_loops_than_loop (chrec, loop_num);
!   *res = (TREE_CODE (scev) != POLYNOMIAL_CHREC
! 	  && TREE_CODE (scev) != EXPONENTIAL_CHREC);
    return true;
  }
  
--- 299,305 ----
      return false;
  
    scev = hide_evolution_in_other_loops_than_loop (chrec, loop_num);
!   *res = !tree_is_chrec (scev);
    return true;
  }
  
Index: tree-data-ref.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-data-ref.c,v
retrieving revision 1.1.2.18
diff -c -3 -p -r1.1.2.18 tree-data-ref.c
*** tree-data-ref.c	6 May 2004 14:36:40 -0000	1.1.2.18
--- tree-data-ref.c	9 Jun 2004 17:57:37 -0000
***************
*** 1,5 ****
  /* Data references and dependences detectors.
!    Copyright (C) 2003 Free Software Foundation, Inc.
     Contributed by Sebastian Pop <s.pop@laposte.net>
  
  This file is part of GCC.
--- 1,5 ----
  /* Data references and dependences detectors.
!    Copyright (C) 2003, 2004 Free Software Foundation, Inc.
     Contributed by Sebastian Pop <s.pop@laposte.net>
  
  This file is part of GCC.
*************** siv_subscript_p (tree chrec_a,
*** 496,506 ****
        switch (TREE_CODE (chrec_a))
  	{
  	case POLYNOMIAL_CHREC:
- 	case EXPONENTIAL_CHREC:
  	  switch (TREE_CODE (chrec_b))
  	    {
  	    case POLYNOMIAL_CHREC:
- 	    case EXPONENTIAL_CHREC:
  	      if (CHREC_VARIABLE (chrec_a) != CHREC_VARIABLE (chrec_b))
  		return false;
  	      
--- 496,504 ----
Index: tree-data-ref.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-data-ref.h,v
retrieving revision 1.1.2.12
diff -c -3 -p -r1.1.2.12 tree-data-ref.h
*** tree-data-ref.h	10 May 2004 15:23:53 -0000	1.1.2.12
--- tree-data-ref.h	9 Jun 2004 17:57:37 -0000
***************
*** 1,5 ****
  /* Data references and dependences detectors. 
!    Copyright (C) 2003 Free Software Foundation, Inc.
     Contributed by Sebastian Pop <s.pop@laposte.net>
  
  This file is part of GCC.
--- 1,5 ----
  /* Data references and dependences detectors. 
!    Copyright (C) 2003, 2004 Free Software Foundation, Inc.
     Contributed by Sebastian Pop <s.pop@laposte.net>
  
  This file is part of GCC.
Index: tree-pretty-print.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-pretty-print.c,v
retrieving revision 1.1.2.70.2.6
diff -c -3 -p -r1.1.2.70.2.6 tree-pretty-print.c
*** tree-pretty-print.c	27 May 2004 14:33:05 -0000	1.1.2.70.2.6
--- tree-pretty-print.c	9 Jun 2004 17:57:37 -0000
*************** dump_generic_node (pretty_printer *buffe
*** 1479,1494 ****
        dump_generic_node (buffer, CHREC_VAR (node), spc, flags, false);
        is_stmt = false;
        break;
- 
-     case EXPONENTIAL_CHREC:
-       pp_string (buffer, "{");
-       dump_generic_node (buffer, CHREC_LEFT (node), spc, flags, false);
-       pp_string (buffer, ", *, ");
-       dump_generic_node (buffer, CHREC_RIGHT (node), spc, flags, false);
-       pp_string (buffer, "}_");
-       dump_generic_node (buffer, CHREC_VAR (node), spc, flags, false);
-       is_stmt = false;
-       break;
        
      case PEELED_CHREC:
        pp_string (buffer, "(");
--- 1479,1484 ----
Index: tree-scalar-evolution.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-scalar-evolution.c,v
retrieving revision 1.1.2.54
diff -c -3 -p -r1.1.2.54 tree-scalar-evolution.c
*** tree-scalar-evolution.c	9 Jun 2004 00:29:06 -0000	1.1.2.54
--- tree-scalar-evolution.c	9 Jun 2004 17:57:38 -0000
*************** Software Foundation, 59 Temple Place - S
*** 210,243 ****
     updates the description of the algorithms to reflect the design
     choices used in this implementation.
       
!    A set of slides show a high level overview of the algorithm and
!    run an example through the scalar evolution analyzer:
     http://cri.ensmp.fr/~pop/gcc/mar04/slides.pdf
!      
!    Fixmes:
!    
!    FIXME taylor: This FIXME concerns all the cases where we have to
!    deal with additions of exponential functions: "exp + exp" or
!    "poly + exp" or "cst + exp".  This could be handled by a Taylor
!    decomposition of the exponential function, but this is still
!    under construction (not implemented yet, or chrec_top).
!      
!    The idea is to represent the exponential evolution functions
!    using infinite degree polynomials:
!      
!    | a -> {1, *, 2}_1 = {1, +, 1, +, 1, +, ...}_1 = {1, +, a}_1
!      
!    Proof:
!    \begin{eqnarray*}
!    \{1, *, t+1\} (x) &=& exp \left(log (1) + log (t+1) \binom{x}{1} \right) \\
!    &=& (t+1)^x \\
!    &=& \binom{x}{0} + \binom{x}{1}t + \binom{x}{2}t^2 + 
!    \ldots + \binom{x}{x}t^x \\
!    &=& \{1, +, t, +, t^2, +, \ldots, +, t^x\} \\
!    \end{eqnarray*}
!      
!    While this equality is simple to prove for exponentials of degree
!    1, it is still work in progress for higher degree exponentials.
  */
  
  #include "config.h"
--- 210,221 ----
     updates the description of the algorithms to reflect the design
     choices used in this implementation.
       
!    A set of slides show a high level overview of the algorithm and run
!    an example through the scalar evolution analyzer:
     http://cri.ensmp.fr/~pop/gcc/mar04/slides.pdf
! 
!    The slides that I have presented at the GCC Summit'04 are available
!    at: http://cri.ensmp.fr/~pop/gcc/20040604/gccsummit-lno-spop.pdf
  */
  
  #include "config.h"
*************** loop_phi_node_p (tree phi)
*** 497,504 ****
      
     | i_1 = i_0 + 20
     
!    This overall effect of the loop is obtained by passing in the
!    parameters: LOOP = 1, EVOLUTION_FN {i_0, +, 2}_1.
  */
   
  static tree 
--- 475,483 ----
      
     | i_1 = i_0 + 20
     
!    The overall effect of the loop, "i_0 + 20" in the previous example, 
!    is obtained by passing in the parameters: LOOP = 1, 
!    EVOLUTION_FN = {i_0, +, 2}_1.
  */
   
  static tree 
*************** chrec_is_positive (tree chrec, bool *val
*** 577,583 ****
        return value0 == value1;
  
      case POLYNOMIAL_CHREC:
-     case EXPONENTIAL_CHREC:
        if (!chrec_is_positive (CHREC_LEFT (chrec), &value0)
  	  || !chrec_is_positive (CHREC_RIGHT (chrec), &value1))
  	return false;
--- 556,561 ----
*************** add_to_evolution_1 (unsigned loop_nb, 
*** 746,769 ****
  	   add_to_evolution_1 (loop_nb, CHREC_LEFT (chrec_before), to_add),
  	   CHREC_RIGHT (chrec_before));
        
-     case EXPONENTIAL_CHREC:
-       if (CHREC_VARIABLE (chrec_before) == loop_nb)
- 	/* We still don't know how to fold these operations that mix
- 	   polynomial and exponential functions.  For the moment, give
- 	   a rough approximation: [-oo, +oo].  */
- 	return build_exponential_chrec (loop_nb, CHREC_LEFT (chrec_before),
- 					chrec_top);
- 
-       /* When there is no evolution part in this loop, build it.  */
-       else if (CHREC_VARIABLE (chrec_before) < loop_nb)
- 	return build_polynomial_chrec (loop_nb, chrec_before, to_add);
- 
-       else
- 	return build_exponential_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_top)
--- 724,729 ----
*************** add_to_evolution (unsigned loop_nb, 
*** 920,927 ****
    
    /* TO_ADD is either a scalar, or a parameter.  TO_ADD is not
       instantiated at this point.  */
!   if (TREE_CODE (to_add) == POLYNOMIAL_CHREC
!       || TREE_CODE (to_add) == EXPONENTIAL_CHREC)
      /* This should not happen.  */
      return chrec_top;
    
--- 880,886 ----
    
    /* TO_ADD is either a scalar, or a parameter.  TO_ADD is not
       instantiated at this point.  */
!   if (TREE_CODE (to_add) == POLYNOMIAL_CHREC)
      /* This should not happen.  */
      return chrec_top;
    
*************** add_to_evolution (unsigned loop_nb, 
*** 952,1060 ****
    return res;
  }
  
- /* When CHREC_BEFORE has an evolution part in LOOP_NB, multiply its
-    evolution by the expression TO_MULT, otherwise construct an
-    evolution part for this loop.  */
- 
- static tree
- multiply_evolution_1 (unsigned loop_nb, 
- 		      tree chrec_before, 
- 		      tree to_mult)
- {
-   if (chrec_before == chrec_not_analyzed_yet)
-     return chrec_not_analyzed_yet;
-   
-   switch (TREE_CODE (chrec_before))
-     {
-     case POLYNOMIAL_CHREC:
-       if (CHREC_VARIABLE (chrec_before) == loop_nb)
- 	/* We still don't know how to fold these operations that mix
- 	   polynomial and exponential functions.  For the moment, give
- 	   a rough approximation: [-oo, +oo].  */
- 	return build_polynomial_chrec (loop_nb, CHREC_LEFT (chrec_before),
- 				       chrec_top);
- 
-       /* When there is no evolution part in this loop, build it.  */
-       else if (CHREC_VARIABLE (chrec_before) < loop_nb)
- 	return build_exponential_chrec (loop_nb, chrec_before, to_mult);
- 
-       else
- 	return build_polynomial_chrec 
- 	  (CHREC_VARIABLE (chrec_before),
- 	   multiply_evolution_1 (loop_nb, CHREC_LEFT (chrec_before), to_mult),
- 	   CHREC_RIGHT (chrec_before));
-       
-     case EXPONENTIAL_CHREC:
-       if (CHREC_VARIABLE (chrec_before) == loop_nb
- 	  /* The evolution has to be multiplied on the leftmost position for 
- 	     loop_nb.  */
- 	  && ((TREE_CODE (CHREC_LEFT (chrec_before)) != POLYNOMIAL_CHREC
- 	       && TREE_CODE (CHREC_LEFT (chrec_before)) != EXPONENTIAL_CHREC)
- 	      || (CHREC_VARIABLE (CHREC_LEFT (chrec_before)) != loop_nb)))
- 	return build_exponential_chrec
- 	  (loop_nb, 
- 	   CHREC_LEFT (chrec_before),
- 	   chrec_fold_multiply (chrec_type (to_mult), 
- 				CHREC_RIGHT (chrec_before), to_mult));
- 
-       else if (CHREC_VARIABLE (chrec_before) < loop_nb)
- 	return build_exponential_chrec (loop_nb, chrec_before, to_mult);
- 
-       else
- 	return build_exponential_chrec 
- 	  (CHREC_VARIABLE (chrec_before),
- 	   multiply_evolution_1 (loop_nb, CHREC_LEFT (chrec_before), to_mult),
- 	   CHREC_RIGHT (chrec_before));
-       
-     default:
-       /* These nodes do not depend on a loop.  */
-       return build_exponential_chrec (loop_nb, chrec_before, to_mult);
-     }
- }
- 
- /* Add TO_MULT to the evolution part of CHREC_BEFORE in the dimension
-    of LOOP_NB.  */
- 
- static tree 
- multiply_evolution (unsigned loop_nb, 
- 		    tree chrec_before,
- 		    tree to_mult)
- {
-   tree res = NULL_TREE;
- 
-   if (to_mult == chrec_not_analyzed_yet)
-     return chrec_before;
- 
-   /* TO_MULT is either a scalar, or a parameter.  TO_MULT is not
-      instantiated at this point.  */
-   if (TREE_CODE (to_mult) == POLYNOMIAL_CHREC
-       || TREE_CODE (to_mult) == EXPONENTIAL_CHREC)
-     /* This should not happen.  */
-     return chrec_top;
-   
-   if (dump_file && (dump_flags & TDF_DETAILS))
-     {
-       fprintf (dump_file, "(multiply_evolution \n");
-       fprintf (dump_file, "  (loop_nb = %d)\n", loop_nb);
-       fprintf (dump_file, "  (chrec_before = ");
-       print_generic_expr (dump_file, chrec_before, 0);
-       fprintf (dump_file, ")\n  (to_mult = ");
-       print_generic_expr (dump_file, to_mult, 0);
-       fprintf (dump_file, ")\n");
-     }
- 
-   res = multiply_evolution_1 (loop_nb, chrec_before, to_mult);
- 
-   if (dump_file && (dump_flags & TDF_DETAILS))
-     {
-       fprintf (dump_file, "  (res = ");
-       print_generic_expr (dump_file, res, 0);
-       fprintf (dump_file, "))\n");
-     }
-   
-   return res;
- }
- 
  
  
  /* This section deals with the approximation of the number of
--- 911,916 ----
*************** first_iteration_non_satisfying_ev_noev (
*** 1174,1180 ****
    if (!evolution_function_is_affine_p (ev_in_this_loop))
      /* For the moment handle only polynomials of degree 1.  */
      return chrec_top;
!   
    init0 = CHREC_LEFT (ev_in_this_loop);
    step0 = CHREC_RIGHT (ev_in_this_loop);
    init1 = initial_condition (chrec1);
--- 1030,1036 ----
    if (!evolution_function_is_affine_p (ev_in_this_loop))
      /* For the moment handle only polynomials of degree 1.  */
      return chrec_top;
! 
    init0 = CHREC_LEFT (ev_in_this_loop);
    step0 = CHREC_RIGHT (ev_in_this_loop);
    init1 = initial_condition (chrec1);
*************** first_iteration_non_satisfying_ev_ev (en
*** 1215,1220 ****
--- 1071,1081 ----
      /* For the moment, don't handle these quite difficult cases.  */
      return chrec_top;
  
+   if (!evolution_function_is_affine_p (chrec0)
+       || !evolution_function_is_affine_p (chrec1))
+     /* For the moment handle only polynomials of degree 1.  */
+     return chrec_top;
+ 
    init0 = CHREC_LEFT (chrec0);
    step0 = CHREC_RIGHT (chrec0);
    init1 = CHREC_LEFT (chrec1);
*************** follow_ssa_edge_in_rhs (struct loop *loo
*** 1713,1720 ****
  		 evolution_of_loop);
  	      
  	      if (res)
! 		*evolution_of_loop = multiply_evolution 
! 		  (loop->num, *evolution_of_loop, rhs1);
  	      
  	      else
  		{
--- 1574,1580 ----
  		 evolution_of_loop);
  	      
  	      if (res)
! 		*evolution_of_loop = chrec_top;
  	      
  	      else
  		{
*************** follow_ssa_edge_in_rhs (struct loop *loo
*** 1723,1730 ****
  		     evolution_of_loop);
  		  
  		  if (res)
! 		    *evolution_of_loop = multiply_evolution 
! 		      (loop->num, *evolution_of_loop, rhs0);
  		}
  	    }
  	  
--- 1583,1589 ----
  		     evolution_of_loop);
  		  
  		  if (res)
! 		    *evolution_of_loop = chrec_top;
  		}
  	    }
  	  
*************** follow_ssa_edge_in_rhs (struct loop *loo
*** 1736,1743 ****
  		(loop, SSA_NAME_DEF_STMT (rhs0), halting_phi, 
  		 evolution_of_loop);
  	      if (res)
! 		*evolution_of_loop = multiply_evolution 
! 		  (loop->num, *evolution_of_loop, rhs1);
  	    }
  	}
        
--- 1595,1601 ----
  		(loop, SSA_NAME_DEF_STMT (rhs0), halting_phi, 
  		 evolution_of_loop);
  	      if (res)
! 		*evolution_of_loop = chrec_top;
  	    }
  	}
        
*************** follow_ssa_edge_in_rhs (struct loop *loo
*** 1749,1756 ****
  	    (loop, SSA_NAME_DEF_STMT (rhs1), halting_phi, 
  	     evolution_of_loop);
  	  if (res)
! 	    *evolution_of_loop = multiply_evolution 
! 	      (loop->num, *evolution_of_loop, rhs0);
  	}
        
        else
--- 1607,1613 ----
  	    (loop, SSA_NAME_DEF_STMT (rhs1), halting_phi, 
  	     evolution_of_loop);
  	  if (res)
! 	    *evolution_of_loop = chrec_top;
  	}
        
        else
*************** instantiate_parameters_1 (struct loop *l
*** 2477,2489 ****
  				      allow_superloop_chrecs);
        return build_polynomial_chrec (CHREC_VARIABLE (chrec), op0, op1);
  
-     case EXPONENTIAL_CHREC:
-       op0 = instantiate_parameters_1 (loop, CHREC_LEFT (chrec),
- 				      allow_superloop_chrecs);
-       op1 = instantiate_parameters_1 (loop, CHREC_RIGHT (chrec),
- 				      allow_superloop_chrecs);
-       return build_exponential_chrec (CHREC_VARIABLE (chrec), op0, op1);
- 
      case PEELED_CHREC:
        op0 = instantiate_parameters_1 (loop, CHREC_LEFT (chrec),
  				      allow_superloop_chrecs);
--- 2334,2339 ----
*************** struct chrec_stats 
*** 2792,2798 ****
    unsigned nb_affine;
    unsigned nb_affine_multivar;
    unsigned nb_higher_poly;
-   unsigned nb_expo;
    unsigned nb_chrec_top;
    unsigned nb_interval_chrec;
    unsigned nb_undetermined;
--- 2642,2647 ----
*************** reset_chrecs_counters (struct chrec_stat
*** 2808,2814 ****
    stats->nb_affine = 0;
    stats->nb_affine_multivar = 0;
    stats->nb_higher_poly = 0;
-   stats->nb_expo = 0;
    stats->nb_chrec_top = 0;
    stats->nb_interval_chrec = 0;
    stats->nb_undetermined = 0;
--- 2657,2662 ----
*************** dump_chrecs_stats (FILE *file, struct ch
*** 2826,2832 ****
    fprintf (file, "%d\tdegree greater than 2 polynomials\n", 
  	   stats->nb_higher_poly);
    fprintf (file, "%d\taffine peeled chrecs\n", stats->nb_peeled);
-   fprintf (file, "%d\texponential chrecs\n", stats->nb_expo);
    fprintf (file, "%d\tchrec_top chrecs\n", stats->nb_chrec_top);
    fprintf (file, "%d\tinterval chrecs\n", stats->nb_chrec_top);
    fprintf (file, "-----------------------------------------\n");
--- 2674,2679 ----
*************** gather_chrec_stats (tree chrec, struct c
*** 2886,2897 ****
        
        break;
        
-     case EXPONENTIAL_CHREC:
-       if (dump_file && (dump_flags & TDF_STATS))
- 	fprintf (dump_file, "  exponential\n");
-       stats->nb_expo++;
-       break;
- 
      case INTERVAL_CHREC:
        if (chrec == chrec_top)
  	{
--- 2733,2738 ----
Index: tree-scalar-evolution.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-scalar-evolution.h,v
retrieving revision 1.1.2.11
diff -c -3 -p -r1.1.2.11 tree-scalar-evolution.h
*** tree-scalar-evolution.h	30 Apr 2004 23:38:49 -0000	1.1.2.11
--- tree-scalar-evolution.h	9 Jun 2004 17:57:38 -0000
***************
*** 1,5 ****
  /* Scalar evolution detector.
!    Copyright (C) 2003 Free Software Foundation, Inc.
     Contributed by Sebastian Pop <s.pop@laposte.net>
  
  This file is part of GCC.
--- 1,5 ----
  /* Scalar evolution detector.
!    Copyright (C) 2003, 2004 Free Software Foundation, Inc.
     Contributed by Sebastian Pop <s.pop@laposte.net>
  
  This file is part of GCC.
Index: tree-vectorizer.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-vectorizer.c,v
retrieving revision 1.1.2.35
diff -c -3 -p -r1.1.2.35 tree-vectorizer.c
*** tree-vectorizer.c	9 Jun 2004 10:32:31 -0000	1.1.2.35
--- tree-vectorizer.c	9 Jun 2004 17:57:38 -0000
*************** vect_is_simple_iv_evolution (unsigned lo
*** 2227,2236 ****
    if (evolution_part == NULL_TREE)
      return false;
    
!   /* When the evolution is a polynomial of degree >= 2 or
!      exponential, the evolution function is not "simple".  */
!   if (TREE_CODE (evolution_part) == POLYNOMIAL_CHREC
!       || TREE_CODE (evolution_part) == EXPONENTIAL_CHREC)
      return false;
    
    step_expr = evolution_part;
--- 2227,2235 ----
    if (evolution_part == NULL_TREE)
      return false;
    
!   /* When the evolution is a polynomial of degree >= 2
!      the evolution function is not "simple".  */
!   if (tree_is_chrec (evolution_part))
      return false;
    
    step_expr = evolution_part;
*************** vect_analyze_loop_with_symbolic_num_of_i
*** 3481,3491 ****
  	return false;
    
        /* FORNOW: We do not transform initial conditions of IVs 
! 	 which evolution functions are a polynomial of degree >= 2 or
! 	 exponential.  */
  
!       if (TREE_CODE (evolution_part) == POLYNOMIAL_CHREC
! 	  || TREE_CODE (evolution_part) == EXPONENTIAL_CHREC)
  	return false;  
      }
  
--- 3480,3488 ----
  	return false;
    
        /* FORNOW: We do not transform initial conditions of IVs 
! 	 which evolution functions are a polynomial of degree >= 2.  */
  
!       if (tree_is_chrec (evolution_part))
  	return false;  
      }
  
Index: tree.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.def,v
retrieving revision 1.52.2.21.2.6
diff -c -3 -p -r1.52.2.21.2.6 tree.def
*** tree.def	27 May 2004 14:33:11 -0000	1.52.2.21.2.6
--- tree.def	9 Jun 2004 17:57:38 -0000
*************** DEFTREECODE (INTERVAL_CHREC, "interval_c
*** 905,914 ****
     Under the form: cr = {CHREC_LEFT (cr), +, CHREC_RIGHT (cr)}.  */
  DEFTREECODE (POLYNOMIAL_CHREC, "polynomial_chrec", 'e', 3)
  
- /* Exponential chains of recurrences.
-    Under the form: cr = {CHREC_LEFT (cr), *, CHREC_RIGHT (cr)}.  */
- DEFTREECODE (EXPONENTIAL_CHREC, "exponential_chrec", 'e', 3)
- 
  /* Peeled chains of recurrences.
     Under the form: (CHREC_LEFT (cr), CHREC_RIGHT (cr)).  */
  DEFTREECODE (PEELED_CHREC, "peeled_chrec", 'e', 3)
--- 905,910 ----



More information about the Gcc-patches mailing list