OSDN Git Service

Don't call pbb_to_depth_to_oldiv from compute_type_for_level.
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 12 Jun 2010 07:39:25 +0000 (07:39 +0000)
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 12 Jun 2010 07:39:25 +0000 (07:39 +0000)
2010-06-12  Sebastian Pop  <sebastian.pop@amd.com>

* graphite-clast-to-gimple.c (gcc_type_for_interval): Do not pass
old_type in parameter.
(gcc_type_for_value): Update call to gcc_type_for_interval.
(compute_type_for_level_1): Renamed compute_type_for_level.
Update call to gcc_type_for_interval.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160649 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/graphite-clast-to-gimple.c

index 4c5d32b..3d1b0eb 100644 (file)
@@ -1,3 +1,11 @@
+2010-06-12  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * graphite-clast-to-gimple.c (gcc_type_for_interval): Do not pass
+       old_type in parameter.
+       (gcc_type_for_value): Update call to gcc_type_for_interval.
+       (compute_type_for_level_1): Renamed compute_type_for_level.
+       Update call to gcc_type_for_interval.
+
 2010-06-11  Joseph Myers  <joseph@codesourcery.com>
 
        * common.opt (Wstrict-aliasing=, Wstrict-overflow=, fabi-version=,
index 3240c37..8116afe 100644 (file)
@@ -469,11 +469,10 @@ precision_for_interval (mpz_t low, mpz_t up)
   return precision;
 }
 
-/* Return a type that could represent the integer value VAL, or
-   otherwise return NULL_TREE.  */
+/* Return a type that could represent the integer value VAL.  */
 
 static tree
-gcc_type_for_interval (mpz_t low, mpz_t up, tree old_type)
+gcc_type_for_interval (mpz_t low, mpz_t up)
 {
   bool unsigned_p = true;
   int precision, prec_up, prec_int;
@@ -482,14 +481,12 @@ gcc_type_for_interval (mpz_t low, mpz_t up, tree old_type)
 
   gcc_assert (value_le (low, up));
 
-  /* Preserve the signedness of the old IV.  */
-  if ((old_type && !TYPE_UNSIGNED (old_type))
-      || value_neg_p (low))
+  if (value_neg_p (low))
     unsigned_p = false;
 
   prec_up = precision_for_value (up);
   prec_int = precision_for_interval (low, up);
-  precision = prec_up > prec_int ? prec_up : prec_int;
+  precision = MAX (prec_up, prec_int);
 
   if (precision > BITS_PER_WORD)
     {
@@ -516,7 +513,7 @@ gcc_type_for_interval (mpz_t low, mpz_t up, tree old_type)
 static tree
 gcc_type_for_value (mpz_t val)
 {
-  return gcc_type_for_interval (val, val, NULL_TREE);
+  return gcc_type_for_interval (val, val);
 }
 
 /* Return the type for the clast_term T used in STMT.  */
@@ -726,11 +723,10 @@ compute_bounds_for_level (poly_bb_p pbb, int level, mpz_t low, mpz_t up)
 }
 
 /* Compute the type for the induction variable at LEVEL for the
-   statement PBB, based on the transformed schedule of PBB.  OLD_TYPE
-   is the type of the old induction variable for that loop.  */
+   statement PBB, based on the transformed schedule of PBB.  */
 
 static tree
-compute_type_for_level_1 (poly_bb_p pbb, int level, tree old_type)
+compute_type_for_level (poly_bb_p pbb, int level)
 {
   mpz_t low, up;
   tree type;
@@ -739,39 +735,13 @@ compute_type_for_level_1 (poly_bb_p pbb, int level, tree old_type)
   value_init (up);
 
   compute_bounds_for_level (pbb, level, low, up);
-  type = gcc_type_for_interval (low, up, old_type);
+  type = gcc_type_for_interval (low, up);
 
   value_clear (low);
   value_clear (up);
   return type;
 }
 
-/* Compute the type for the induction variable at LEVEL for the
-   statement PBB, based on the transformed schedule of PBB.  */
-
-static tree
-compute_type_for_level (poly_bb_p pbb, int level)
-{
-  tree oldiv = pbb_to_depth_to_oldiv (pbb, level);
-  tree type = TREE_TYPE (oldiv);
-
-  if (type && POINTER_TYPE_P (type))
-    {
-#ifdef ENABLE_CHECKING
-      tree ctype = compute_type_for_level_1 (pbb, level, type);
-
-      /* In the case of a pointer type, check that after the loop
-        transform, the lower and the upper bounds of the type fit the
-        oldiv pointer type.  */
-      gcc_assert (TYPE_PRECISION (type) >= TYPE_PRECISION (ctype)
-                 && integer_zerop (lower_bound_in_type (ctype, ctype)));
-#endif
-      return type;
-    }
-
-  return compute_type_for_level_1 (pbb, level, type);
-}
-
 /* Walks a CLAST and returns the first statement in the body of a
    loop.  */