+2010-04-04 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/43519
+ * Makefile.in (graphite-clast-to-gimple.o): Depends on langhooks.h.
+ * graphite-clast-to-gimple.c: Include langhooks.h.
+ (max_signed_precision_type): New.
+ (max_precision_type): Takes two types as arguments.
+ (precision_for_value): New.
+ (precision_for_interval): New.
+ (gcc_type_for_interval): New.
+ (gcc_type_for_value): New.
+ (gcc_type_for_clast_term): New.
+ (gcc_type_for_clast_red): New.
+ (gcc_type_for_clast_bin): New.
+ (gcc_type_for_clast_expr): Split up into several functions.
+ (gcc_type_for_clast_eq): Rewritten.
+ (compute_bounds_for_level): New.
+ (compute_type_for_level_1): New.
+ (compute_type_for_level): New.
+ (gcc_type_for_cloog_iv): Removed.
+ (gcc_type_for_iv_of_clast_loop): Rewritten.
+ (graphite_create_new_loop): Compute the lower and upper bound types
+ with gcc_type_for_clast_expr.
+ (graphite_create_new_loop_guard): Same.
+ (find_cloog_iv_in_expr): Removed.
+ (compute_cloog_iv_types_1): Removed.
+ (compute_cloog_iv_types): Removed.
+ (gloog): Do not call compute_cloog_iv_types.
+ * graphite-sese-to-poly.c (new_gimple_bb): Do not initialize
+ GBB_CLOOG_IV_TYPES.
+ (free_data_refs_aux): Do not free GBB_CLOOG_IV_TYPES.
+ * sese.h (struct gimple_bb): Removed field cloog_iv_types.
+ (GBB_CLOOG_IV_TYPES): Removed.
+
+ * gcc.dg/graphite/run-id-pr42644.c: Call abort.
+
2010-04-02 Sebastian Pop <sebastian.pop@amd.com>
Reverted this commit: as at this point the loop closed SSA form
{
int p1 = TYPE_PRECISION (type1);
int p2 = TYPE_PRECISION (type2);
- int precision;
- tree type;
-
- if (p1 > p2)
- precision = TYPE_UNSIGNED (type1) ? p1 * 2 : p1;
- else
- precision = TYPE_UNSIGNED (type2) ? p2 * 2 : p2;
-
- type = lang_hooks.types.type_for_size (precision, false);
+ int precision = p1 > p2 ? p1 : p2;
+ tree type = lang_hooks.types.type_for_size (precision, false);
if (!type)
{
static tree
max_precision_type (tree type1, tree type2)
{
+
if (POINTER_TYPE_P (type1))
return type1;
/* Return the precision needed to represent the value VAL. */
static int
-precision_for_value (mpz_t val)
+precision_for_value (Value val)
{
- mpz_t x, y, two;
+ Value x, y, two;
int precision;
value_init (x);
UP. */
static int
-precision_for_interval (mpz_t low, mpz_t up)
+precision_for_interval (Value low, Value up)
{
- mpz_t diff;
+ Value diff;
int precision;
gcc_assert (value_le (low, up));
otherwise return NULL_TREE. */
static tree
-gcc_type_for_interval (mpz_t low, mpz_t up, tree old_type)
+gcc_type_for_interval (Value low, Value up, tree old_type)
{
bool unsigned_p = true;
int precision, prec_up, prec_int;
otherwise return NULL_TREE. */
static tree
-gcc_type_for_value (mpz_t val)
+gcc_type_for_value (Value val)
{
return gcc_type_for_interval (val, val, NULL_TREE);
}
the iteration domain, and G the context parameters. */
static void
-compute_bounds_for_level (poly_bb_p pbb, int level, mpz_t low, mpz_t up)
+compute_bounds_for_level (poly_bb_p pbb, int level, Value low, Value up)
{
ppl_Pointset_Powerset_C_Polyhedron_t ps;
ppl_Linear_Expression_t le;
/* 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. */
-/* Java does not initialize long_long_integer_type_node. */
-#define my_long_long (long_long_integer_type_node ? long_long_integer_type_node : ssizetype)
-
-/* Given a CLOOG_IV, return the type that CLOOG_IV should have in GCC
- land. The selected type is big enough to include the original loop
- iteration variable, but signed to work with the subtractions CLooG
- may have introduced. If such a type is not available, we fail.
static tree
compute_type_for_level_1 (poly_bb_p pbb, int level, tree old_type)
{
- mpz_t low, up;
+ Value low, up;
tree type;
value_init (low);
if (CLAST_STMT_IS_A (stmt, stmt_for))
return clast_get_body_of_loop (((struct clast_for *) stmt)->body);
- if (type_precision < TYPE_PRECISION (my_long_long))
- return my_long_long;
+ if (CLAST_STMT_IS_A (stmt, stmt_guard))
+ return clast_get_body_of_loop (((struct clast_guard *) stmt)->then);
if (CLAST_STMT_IS_A (stmt, stmt_block))
return clast_get_body_of_loop (((struct clast_block *) stmt)->body);
- return my_long_long;
+ gcc_unreachable ();
}
-#undef my_long_long
-
-/* Returns the induction variable for the loop that gets translated to
- STMT. */
+/* Returns the type for the induction variable for the loop translated
+ from STMT_FOR. */
static tree
gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_for, int level,
CloogStatement *cs = body->statement;
poly_bb_p pbb = (poly_bb_p) cloog_statement_usr (cs);
- return max_signed_precision_type (lb_type, max_precision_type
- (ub_type, compute_type_for_level
- (pbb, level - 1)));
+ return max_precision_type (lb_type, max_precision_type
+ (ub_type, compute_type_for_level (pbb,
+ level - 1)));
}
/* Creates a new LOOP corresponding to Cloog's STMT. Inserts an