[GSoC] generation of Gimple loops with empty bodies

Roman Gareev gareevroman@gmail.com
Fri Jul 18 10:52:00 GMT 2014


> I suggest you use the largest available integer mode via
> mode = mode_for_size (MAX_FIXED_MODE_SIZE, MODE_INT, 0);
> type = build_nonstandard_integer_type (GET_MODE_PRECISION (mode), [01]);

Thank you for the suggestion!

> Roman, can you give this a shot?

Maybe, we could use the following code:

static int max_mode_int_precision =
  GET_MODE_PRECISION (mode_for_size (MAX_FIXED_MODE_SIZE, MODE_INT, 0));
static int graphite_expression_type_precision = 128 <= max_mode_int_precision ?

128 : max_mode_int_precision;

This allows us to change the size during debugging and avoid using
unacceptable mode size. Tobias, what do you think about this?

--
                                   Cheers, Roman Gareev
-------------- next part --------------
2014-07-08  Roman Gareev  <gareevroman@gmail.com>

	gcc/
	* graphite-isl-ast-to-gimple.c:
	Add using of build_nonstandard_integer_type instead of
	int128_integer_type_node.
-------------- next part --------------
Index: gcc/graphite-isl-ast-to-gimple.c
===================================================================
--- gcc/graphite-isl-ast-to-gimple.c	(revision 212804)
+++ gcc/graphite-isl-ast-to-gimple.c	(working copy)
@@ -62,10 +62,13 @@
 
 static bool graphite_regenerate_error;
 
-/* We always use signed 128, until isl is able to give information about
-types  */
+/* We always use signed 128, until it is not accpeted or isl is able to give
+   information about types.  */
 
-static tree *graphite_expression_size_type = &int128_integer_type_node;
+static int max_mode_int_precision =
+  GET_MODE_PRECISION (mode_for_size (MAX_FIXED_MODE_SIZE, MODE_INT, 0));
+static int graphite_expression_type_precision = 128 <= max_mode_int_precision ?
+						128 : max_mode_int_precision;
 
 /* Converts a GMP constant VAL to a tree and returns it.  */
 
@@ -494,7 +497,8 @@
   tree cond_expr;
   edge exit_edge;
 
-  *type = *graphite_expression_size_type;
+  *type =
+    build_nonstandard_integer_type (graphite_expression_type_precision, 0);
   isl_ast_expr *for_init = isl_ast_node_for_get_init (node_for);
   *lb = gcc_expression_from_isl_expression (*type, for_init, ip);
   isl_ast_expr *upper_bound = get_upper_bound (node_for);


More information about the Gcc-patches mailing list