aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2010-06-12 07:39:25 +0000
committerSebastian Pop <spop@gcc.gnu.org>2010-06-12 07:39:25 +0000
commitb53cd1c5cf3aa84837b677fda803c1664857774a (patch)
tree07e4a2a5c4e4379950a9befc5bae4aef1c2d718b
parent6cd8d93a0beea307b26f01d36d0808fbbfa61f1a (diff)
downloadgcc-b53cd1c5cf3aa84837b677fda803c1664857774a.zip
gcc-b53cd1c5cf3aa84837b677fda803c1664857774a.tar.gz
gcc-b53cd1c5cf3aa84837b677fda803c1664857774a.tar.bz2
Don't call pbb_to_depth_to_oldiv from compute_type_for_level.
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. From-SVN: r160649
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/graphite-clast-to-gimple.c46
2 files changed, 16 insertions, 38 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4c5d32b..3d1b0eb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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=,
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 3240c37..8116afe 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -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. */