summaryrefslogtreecommitdiff
path: root/gcc/sese.h
diff options
context:
space:
mode:
authorgrosser <grosser@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-30 22:06:27 +0000
committergrosser <grosser@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-30 22:06:27 +0000
commitc9ef6b0ef08751c3a3770da15d38c1ef59ee2ec0 (patch)
tree8557f4e933b1efe957ca676604b348d1e69abdc2 /gcc/sese.h
parent83b6c9dbe59299f469b81f88a1de57609e1257f9 (diff)
downloadgcc-c9ef6b0ef08751c3a3770da15d38c1ef59ee2ec0.tar.gz
Do not abuse sese for codegeneration
CLooG automatically frees the names list, so sharing SESE_PARAMS_NAMES between gloog() and debug_generated_program() leads to freeing them twice. As both SESE_PARAM_NAMES and SESE_PARAMS_INDEX are code generation data structures remove them and the functions working on them from sese.h and put them in clast-to-gimple. 2009-11-21 Tobias Grosser <grosser@fim.uni-passau.de> * graphite-clast-to-gimple.c (clast_name_index, new_clast_name_index, clast_name_to_index, save_clast_name_index, debug_clast_name_index, debug_clast_name_indexes_1, debug_clast_name_indexes, clast_name_index_elt_info, eq_clast_name_indexes): Moved from sese.h. (clast_name_to_gcc, clast_to_gcc_expression, clast_to_gcc_expression_red, gcc_type_for_clast_expr, gcc_type_for_clast_eq, graphite_translate_clast_equation, graphite_create_guard_cond_expr, graphite_create_new_loop, translate_clast): Add params_index. (initialize_cloog_names): Create parameter strings from scratch, do not reference other strings. (create_params_index): New. (gloog): Initialize params_index. * graphite-scop-detection (free_scops_1): Removed. (limit_scops): Use normal free_scops. * graphite-sese-to-poly.c (save_var_names): Removed. (parameter_index_in_region): Do not initialize SESE_PARAM_NAMES and SESE_PARAMS_INDEX. * sese.c (new_sese, free_sese): Dito. * sese.h (struct sese): Remove params_index, params_names. (SESE_PARAMS_INDEX, SESE_PARAMS_NAMES): Removed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154844 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sese.h')
-rw-r--r--gcc/sese.h107
1 files changed, 0 insertions, 107 deletions
diff --git a/gcc/sese.h b/gcc/sese.h
index c126a6964f8..6763db34c27 100644
--- a/gcc/sese.h
+++ b/gcc/sese.h
@@ -32,12 +32,6 @@ typedef struct sese_s
/* Parameters used within the SCOP. */
VEC (tree, heap) *params;
- /* Used to quickly retrieve the index of a parameter in PARAMS. */
- htab_t params_index;
-
- /* Store the names of the parameters that are passed to CLooG. */
- char **params_names;
-
/* Loops completely contained in the SCOP. */
bitmap loops;
VEC (loop_p, heap) *loop_nest;
@@ -53,8 +47,6 @@ typedef struct sese_s
#define SESE_EXIT(S) (S->exit)
#define SESE_EXIT_BB(S) (S->exit->dest)
#define SESE_PARAMS(S) (S->params)
-#define SESE_PARAMS_INDEX(S) (S->params_index)
-#define SESE_PARAMS_NAMES(S) (S->params_names)
#define SESE_LOOPS(S) (S->loops)
#define SESE_LOOP_NEST(S) (S->loop_nest)
#define SESE_ADD_PARAMS(S) (S->add_params)
@@ -222,105 +214,6 @@ block_before_sese (sese sese)
return SESE_ENTRY (sese)->src;
}
-/* Stores the INDEX in a vector for a given clast NAME. */
-
-typedef struct clast_name_index {
- int index;
- const char *name;
-} *clast_name_index_p;
-
-/* Returns a pointer to a new element of type clast_name_index_p built
- from NAME and INDEX. */
-
-static inline clast_name_index_p
-new_clast_name_index (const char *name, int index)
-{
- clast_name_index_p res = XNEW (struct clast_name_index);
-
- res->name = name;
- res->index = index;
- return res;
-}
-
-/* For a given clast NAME, returns -1 if it does not correspond to any
- parameter, or otherwise, returns the index in the PARAMS or
- SCATTERING_DIMENSIONS vector. */
-
-static inline int
-clast_name_to_index (const char *name, htab_t index_table)
-{
- struct clast_name_index tmp;
- PTR *slot;
-
- tmp.name = name;
- slot = htab_find_slot (index_table, &tmp, NO_INSERT);
-
- if (slot && *slot)
- return ((struct clast_name_index *) *slot)->index;
-
- return -1;
-}
-
-/* Records in INDEX_TABLE the INDEX for NAME. */
-
-static inline void
-save_clast_name_index (htab_t index_table, const char *name, int index)
-{
- struct clast_name_index tmp;
- PTR *slot;
-
- tmp.name = name;
- slot = htab_find_slot (index_table, &tmp, INSERT);
-
- if (slot)
- *slot = new_clast_name_index (name, index);
-}
-
-/* Print to stderr the element ELT. */
-
-static inline void
-debug_clast_name_index (clast_name_index_p elt)
-{
- fprintf (stderr, "(index = %d, name = %s)\n", elt->index, elt->name);
-}
-
-/* Helper function for debug_rename_map. */
-
-static inline int
-debug_clast_name_indexes_1 (void **slot, void *s ATTRIBUTE_UNUSED)
-{
- struct clast_name_index *entry = (struct clast_name_index *) *slot;
- debug_clast_name_index (entry);
- return 1;
-}
-
-/* Print to stderr all the elements of MAP. */
-
-static inline void
-debug_clast_name_indexes (htab_t map)
-{
- htab_traverse (map, debug_clast_name_indexes_1, NULL);
-}
-
-/* Computes a hash function for database element ELT. */
-
-static inline hashval_t
-clast_name_index_elt_info (const void *elt)
-{
- return htab_hash_pointer (((const struct clast_name_index *) elt)->name);
-}
-
-/* Compares database elements E1 and E2. */
-
-static inline int
-eq_clast_name_indexes (const void *e1, const void *e2)
-{
- const struct clast_name_index *elt1 = (const struct clast_name_index *) e1;
- const struct clast_name_index *elt2 = (const struct clast_name_index *) e2;
-
- return (elt1->name == elt2->name);
-}
-
/* A single entry single exit specialized for conditions. */