diff options
author | Richard Guenther <rguenther@suse.de> | 2012-03-30 08:52:32 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-03-30 08:52:32 +0000 |
commit | aeb83f098d6740d61580014ab78d33abba1168fa (patch) | |
tree | 365ac257e1633f429586b1006dd08eb0fb6d08f6 /gcc/tree-data-ref.c | |
parent | b9268e550b893f065a23e73e76d911cea5480df9 (diff) | |
download | gcc-aeb83f098d6740d61580014ab78d33abba1168fa.zip gcc-aeb83f098d6740d61580014ab78d33abba1168fa.tar.gz gcc-aeb83f098d6740d61580014ab78d33abba1168fa.tar.bz2 |
tree-affine.h (print_aff): Remove.
2012-03-30 Richard Guenther <rguenther@suse.de>
* tree-affine.h (print_aff): Remove.
* tree-affine.c (print_aff): Make static.
* tree-data-ref.h (access_matrix_get_index_for_parameter): Remove.
(get_references_in_stmt): Likewise.
(print_direction_vector): Likewise.
(print_dir_vectors): Likewise.
(print_dist_vectors): Likewise.
(dump_subscript): Likewise.
(dump_ddrs): Likewise.
(dump_dist_dir_vectors): Likewise.
(dump_data_references): Likewise.
(dump_data_dependence_relation): Likewise.
(dump_data_dependence_direction): Likewise.
(dump_rdg_vertex): Likewise.
(dump_rdg_component): Likewise.
(debug_ddrs): Declare.
(struct data_ref_loc_d): Move ...
* tree-data-ref.c (struct data_ref_loc_d): ... here.
(get_references_in_stmt): Make static.
(dump_data_references): Likewise.
(dump_subscript): Likewise.
(print_direction_vector): Likewise.
(print_dir_vectors): Likewise.
(print_dist_vectors): Likewise.
(dump_data_dependence_relation): Likewise.
(dump_dist_dir_vectors): Likewise.
(dump_ddrs): Likewise.
(dump_rdg_vertex): Likewise.
(dump_rdg_component): Likewise.
(debug_ddrs): New function.
(access_matrix_get_index_for_parameter): Remove.
From-SVN: r185994
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r-- | gcc/tree-data-ref.c | 145 |
1 files changed, 54 insertions, 91 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index 9b3a10d..5dcafd3 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -140,7 +140,7 @@ int_divides_p (int a, int b) /* Dump into FILE all the data references from DATAREFS. */ -void +static void dump_data_references (FILE *file, VEC (data_reference_p, heap) *datarefs) { unsigned int i; @@ -158,27 +158,6 @@ debug_data_references (VEC (data_reference_p, heap) *datarefs) dump_data_references (stderr, datarefs); } -/* Dump to STDERR all the dependence relations from DDRS. */ - -DEBUG_FUNCTION void -debug_data_dependence_relations (VEC (ddr_p, heap) *ddrs) -{ - dump_data_dependence_relations (stderr, ddrs); -} - -/* Dump into FILE all the dependence relations from DDRS. */ - -void -dump_data_dependence_relations (FILE *file, - VEC (ddr_p, heap) *ddrs) -{ - unsigned int i; - struct data_dependence_relation *ddr; - - FOR_EACH_VEC_ELT (ddr_p, ddrs, i, ddr) - dump_data_dependence_relation (file, ddr); -} - /* Print to STDERR the data_reference DR. */ DEBUG_FUNCTION void @@ -253,7 +232,7 @@ dump_conflict_function (FILE *outf, conflict_function *cf) /* Dump function for a SUBSCRIPT structure. */ -void +static void dump_subscript (FILE *outf, struct subscript *subscript) { conflict_function *cf = SUB_CONFLICTS_IN_A (subscript); @@ -286,7 +265,7 @@ dump_subscript (FILE *outf, struct subscript *subscript) /* Print the classic direction vector DIRV to OUTF. */ -void +static void print_direction_vector (FILE *outf, lambda_vector dirv, int length) @@ -331,7 +310,7 @@ print_direction_vector (FILE *outf, /* Print a vector of direction vectors. */ -void +static void print_dir_vectors (FILE *outf, VEC (lambda_vector, heap) *dir_vects, int length) { @@ -356,9 +335,9 @@ print_lambda_vector (FILE * outfile, lambda_vector vector, int n) /* Print a vector of distance vectors. */ -void -print_dist_vectors (FILE *outf, VEC (lambda_vector, heap) *dist_vects, - int length) +static void +print_dist_vectors (FILE *outf, VEC (lambda_vector, heap) *dist_vects, + int length) { unsigned j; lambda_vector v; @@ -367,17 +346,9 @@ print_dist_vectors (FILE *outf, VEC (lambda_vector, heap) *dist_vects, print_lambda_vector (outf, v, length); } -/* Debug version. */ - -DEBUG_FUNCTION void -debug_data_dependence_relation (struct data_dependence_relation *ddr) -{ - dump_data_dependence_relation (stderr, ddr); -} - /* Dump function for a DATA_DEPENDENCE_RELATION structure. */ -void +static void dump_data_dependence_relation (FILE *outf, struct data_dependence_relation *ddr) { @@ -450,45 +421,33 @@ dump_data_dependence_relation (FILE *outf, fprintf (outf, ")\n"); } -/* Dump function for a DATA_DEPENDENCE_DIRECTION structure. */ +/* Debug version. */ -void -dump_data_dependence_direction (FILE *file, - enum data_dependence_direction dir) +DEBUG_FUNCTION void +debug_data_dependence_relation (struct data_dependence_relation *ddr) { - switch (dir) - { - case dir_positive: - fprintf (file, "+"); - break; - - case dir_negative: - fprintf (file, "-"); - break; - - case dir_equal: - fprintf (file, "="); - break; + dump_data_dependence_relation (stderr, ddr); +} - case dir_positive_or_negative: - fprintf (file, "+-"); - break; +/* Dump into FILE all the dependence relations from DDRS. */ - case dir_positive_or_equal: - fprintf (file, "+="); - break; +void +dump_data_dependence_relations (FILE *file, + VEC (ddr_p, heap) *ddrs) +{ + unsigned int i; + struct data_dependence_relation *ddr; - case dir_negative_or_equal: - fprintf (file, "-="); - break; + FOR_EACH_VEC_ELT (ddr_p, ddrs, i, ddr) + dump_data_dependence_relation (file, ddr); +} - case dir_star: - fprintf (file, "*"); - break; +/* Dump to STDERR all the dependence relations from DDRS. */ - default: - break; - } +DEBUG_FUNCTION void +debug_data_dependence_relations (VEC (ddr_p, heap) *ddrs) +{ + dump_data_dependence_relations (stderr, ddrs); } /* Dumps the distance and direction vectors in FILE. DDRS contains @@ -496,7 +455,7 @@ dump_data_dependence_direction (FILE *file, dependence vectors, or in other words the number of loops in the considered nest. */ -void +static void dump_dist_dir_vectors (FILE *file, VEC (ddr_p, heap) *ddrs) { unsigned int i, j; @@ -526,7 +485,7 @@ dump_dist_dir_vectors (FILE *file, VEC (ddr_p, heap) *ddrs) /* Dumps the data dependence relations DDRS in FILE. */ -void +static void dump_ddrs (FILE *file, VEC (ddr_p, heap) *ddrs) { unsigned int i; @@ -538,6 +497,12 @@ dump_ddrs (FILE *file, VEC (ddr_p, heap) *ddrs) fprintf (file, "\n\n"); } +DEBUG_FUNCTION void +debug_ddrs (VEC (ddr_p, heap) *ddrs) +{ + dump_ddrs (stderr, ddrs); +} + /* Helper function for split_constant_offset. Expresses OP0 CODE OP1 (the type of the result is TYPE) as VAR + OFF, where OFF is a nonzero constant of type ssizetype, and returns true. If we cannot do this @@ -4236,10 +4201,24 @@ compute_all_dependences (VEC (data_reference_p, heap) *datarefs, return true; } +/* Describes a location of a memory reference. */ + +typedef struct data_ref_loc_d +{ + /* Position of the memory reference. */ + tree *pos; + + /* True if the memory reference is read. */ + bool is_read; +} data_ref_loc; + +DEF_VEC_O (data_ref_loc); +DEF_VEC_ALLOC_O (data_ref_loc, heap); + /* Stores the locations of memory references in STMT to REFERENCES. Returns true if STMT clobbers memory, false otherwise. */ -bool +static bool get_references_in_stmt (gimple stmt, VEC (data_ref_loc, heap) **references) { bool clobbers_memory = false; @@ -4708,7 +4687,7 @@ free_data_refs (VEC (data_reference_p, heap) *datarefs) /* Dump vertex I in RDG to FILE. */ -void +static void dump_rdg_vertex (FILE *file, struct graph *rdg, int i) { struct vertex *v = &(rdg->vertices[i]); @@ -4744,7 +4723,8 @@ debug_rdg_vertex (struct graph *rdg, int i) /* Dump component C of RDG to FILE. If DUMPED is non-null, set the dumped vertices to that bitmap. */ -void dump_rdg_component (FILE *file, struct graph *rdg, int c, bitmap dumped) +static void +dump_rdg_component (FILE *file, struct graph *rdg, int c, bitmap dumped) { int i; @@ -5401,20 +5381,3 @@ remove_similar_memory_refs (VEC (gimple, heap) **stmts) htab_delete (seen); } -/* Returns the index of PARAMETER in the parameters vector of the - ACCESS_MATRIX. If PARAMETER does not exist return -1. */ - -int -access_matrix_get_index_for_parameter (tree parameter, - struct access_matrix *access_matrix) -{ - int i; - VEC (tree,heap) *lambda_parameters = AM_PARAMETERS (access_matrix); - tree lambda_parameter; - - FOR_EACH_VEC_ELT (tree, lambda_parameters, i, lambda_parameter) - if (lambda_parameter == parameter) - return i + AM_NB_INDUCTION_VARS (access_matrix); - - return -1; -} |