summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a6e22f8)
* tree-loop-linear.c (gather_interchange_stats, try_interchange_loops):
Use double_int instead of unsigned int for representing access_strides.
* testsuite/gcc.dg/tree-ssa/pr31183.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122988
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-03-16 Sebastian Pop <sebastian.pop@inria.fr>
+
+ PR tree-optimization/31183
+ * tree-loop-linear.c (gather_interchange_stats, try_interchange_loops):
+ Use double_int instead of unsigned int for representing access_strides.
+ * testsuite/gcc.dg/tree-ssa/pr31183.c: New.
+
2007-03-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/31146
2007-03-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/31146
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+int buf[256 * 9];
+int f()
+{
+ int i, j;
+
+ for (i = 0; i < 256; ++i)
+ for (j = 0; j < 8; ++j)
+ buf[j + 1] = buf[j] + 1;
+
+ return buf[10];
+}
struct loop *first_loop,
unsigned int *dependence_steps,
unsigned int *nb_deps_not_carried_by_loop,
struct loop *first_loop,
unsigned int *dependence_steps,
unsigned int *nb_deps_not_carried_by_loop,
- unsigned int *access_strides)
+ double_int *access_strides)
{
unsigned int i, j;
struct data_dependence_relation *ddr;
{
unsigned int i, j;
struct data_dependence_relation *ddr;
*dependence_steps = 0;
*nb_deps_not_carried_by_loop = 0;
*dependence_steps = 0;
*nb_deps_not_carried_by_loop = 0;
+ *access_strides = double_int_zero;
for (i = 0; VEC_iterate (ddr_p, dependence_relations, i, ddr); i++)
{
for (i = 0; VEC_iterate (ddr_p, dependence_relations, i, ddr); i++)
{
tree chrec = DR_ACCESS_FN (dr, it);
tree tstride = evolution_part_in_loop_num (chrec, loop->num);
tree array_size = TYPE_SIZE (TREE_TYPE (ref));
tree chrec = DR_ACCESS_FN (dr, it);
tree tstride = evolution_part_in_loop_num (chrec, loop->num);
tree array_size = TYPE_SIZE (TREE_TYPE (ref));
if (tstride == NULL_TREE
|| array_size == NULL_TREE
if (tstride == NULL_TREE
|| array_size == NULL_TREE
|| TREE_CODE (array_size) != INTEGER_CST)
continue;
|| TREE_CODE (array_size) != INTEGER_CST)
continue;
- (*access_strides) +=
- int_cst_value (array_size) * int_cst_value (tstride);
+ dstride = double_int_mul (tree_to_double_int (array_size),
+ tree_to_double_int (tstride));
+ (*access_strides) = double_int_add (*access_strides, dstride);
struct loop *loop_i;
struct loop *loop_j;
unsigned int dependence_steps_i, dependence_steps_j;
struct loop *loop_i;
struct loop *loop_j;
unsigned int dependence_steps_i, dependence_steps_j;
- unsigned int access_strides_i, access_strides_j;
+ double_int access_strides_i, access_strides_j;
unsigned int nb_deps_not_carried_by_i, nb_deps_not_carried_by_j;
struct data_dependence_relation *ddr;
unsigned int nb_deps_not_carried_by_i, nb_deps_not_carried_by_j;
struct data_dependence_relation *ddr;
*/
if (dependence_steps_i < dependence_steps_j
|| nb_deps_not_carried_by_i > nb_deps_not_carried_by_j
*/
if (dependence_steps_i < dependence_steps_j
|| nb_deps_not_carried_by_i > nb_deps_not_carried_by_j
- || access_strides_i < access_strides_j)
+ || double_int_ucmp (access_strides_i, access_strides_j) < 0)
{
lambda_matrix_row_exchange (LTM_MATRIX (trans),
loop_i->depth - first_loop->depth,
{
lambda_matrix_row_exchange (LTM_MATRIX (trans),
loop_i->depth - first_loop->depth,