From eaffa76227b6b049f692a9958d24f5fc4f9d27d1 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Fri, 8 Jan 2010 04:35:43 +0000 Subject: Memoize memory strides per loop. 2010-01-07 Sebastian Pop * graphite-interchange.c (memory_stride_in_loop): Renamed pdr_stride_in_loop. (memory_strides_in_loop): Renamed memory_strides_in_loop_1. (memory_strides_in_loop): Memoize the memory strides per loop. (lst_interchange_profitable_p): Do not initialize to zero the memory strides. * graphite-poly.h (struct lst): Add a field memory_strides. (LST_LOOP_MEMORY_STRIDES): New. (new_lst_loop): Initialize LST_LOOP_MEMORY_STRIDES to -1. (free_lst): Clear LST_LOOP_MEMORY_STRIDES. From-SVN: r155725 --- gcc/graphite-poly.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/graphite-poly.h') diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h index 4912801..a2969c7 100644 --- a/gcc/graphite-poly.h +++ b/gcc/graphite-poly.h @@ -632,6 +632,9 @@ struct lst { /* A pointer to the loop that contains this node. */ lst_p loop_father; + /* The sum of all the memory strides for an LST loop. */ + Value memory_strides; + /* Loop nodes contain a sequence SEQ of LST nodes, statements contain a pointer to their polyhedral representation PBB. */ union { @@ -644,6 +647,7 @@ struct lst { #define LST_LOOP_FATHER(LST) ((LST)->loop_father) #define LST_PBB(LST) ((LST)->node.pbb) #define LST_SEQ(LST) ((LST)->node.seq) +#define LST_LOOP_MEMORY_STRIDES(LST) ((LST)->memory_strides) void scop_to_lst (scop_p); void print_lst (FILE *, lst_p, int); @@ -662,6 +666,8 @@ new_lst_loop (VEC (lst_p, heap) *seq) LST_LOOP_P (lst) = true; LST_SEQ (lst) = seq; LST_LOOP_FATHER (lst) = NULL; + value_init (LST_LOOP_MEMORY_STRIDES (lst)); + value_set_si (LST_LOOP_MEMORY_STRIDES (lst), -1); for (i = 0; VEC_iterate (lst_p, seq, i, l); i++) LST_LOOP_FATHER (l) = lst; @@ -698,6 +704,7 @@ free_lst (lst_p lst) for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++) free_lst (l); + value_clear (LST_LOOP_MEMORY_STRIDES (lst)); VEC_free (lst_p, heap, LST_SEQ (lst)); } -- cgit v1.1