From patchwork Fri Mar 30 08:49:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 149588 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 6B093B6EEF for ; Fri, 30 Mar 2012 19:49:42 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1333702183; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Subject:Message-ID:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=kCofzqRSWSEspesG1wYR UsxSnpw=; b=vo0asH1HoEWLWbojKBdueQ/PiyZ4x5Yj8tigVQhRiUGjvvszGJEe V6FqMvzEXrEiVBwveqp/iGV4SHavU0xJ4gLf7wkpNeIsTeBgHRpZt3hfgqI3wNMK I4bERVDf5zGf+i0TjXlIP+hwnLfLCPgA2e9UyeD9ga/vdihlhvvAJng= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=yUNuICSiQD3rVhArpyryOubjFMZNjo3xoUTAOOQGXmpHn+EuMBYZ+QA82unyYF 8r5pI0yxYfbPPL1rvKEFd5dBMRugRNvvNduZTErXlQo1VvypjS35j4VWGJCvWqeK YgV5E6GiUQYTCJlPI6MeMntUyNszQKNeRu76PATSZhovw=; Received: (qmail 4135 invoked by alias); 30 Mar 2012 08:49:37 -0000 Received: (qmail 4124 invoked by uid 22791); 30 Mar 2012 08:49:35 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Mar 2012 08:49:20 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 5CC3592EF4 for ; Fri, 30 Mar 2012 10:49:19 +0200 (CEST) Date: Fri, 30 Mar 2012 10:49:19 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH][4/4] Cleanup internal interfaces Message-ID: MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Last one (for now). Bootstrapped on x86_64-unknown-linux-gnu, applied. Richard. 2012-03-30 Richard Guenther * 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. Index: gcc/tree-affine.h =================================================================== --- gcc/tree-affine.h (revision 185957) +++ gcc/tree-affine.h (working copy) @@ -79,5 +79,4 @@ void free_affine_expand_cache (struct po bool aff_comb_cannot_overlap_p (aff_tree *, double_int, double_int); /* Debugging functions. */ -void print_aff (FILE *, aff_tree *); void debug_aff (aff_tree *); Index: gcc/tree-affine.c =================================================================== --- gcc/tree-affine.c (revision 185957) +++ gcc/tree-affine.c (working copy) @@ -812,7 +812,7 @@ aff_combination_constant_multiple_p (aff /* Prints the affine VAL to the FILE. */ -void +static void print_aff (FILE *file, aff_tree *val) { unsigned i; Index: gcc/tree-data-ref.h =================================================================== --- gcc/tree-data-ref.h (revision 185957) +++ gcc/tree-data-ref.h (working copy) @@ -169,8 +169,6 @@ am_vector_index_for_loop (struct access_ gcc_unreachable(); } -int access_matrix_get_index_for_parameter (tree, struct access_matrix *); - struct data_reference { /* A pointer to the statement that contains this DR. */ @@ -371,22 +369,6 @@ DEF_VEC_ALLOC_P(ddr_p,heap); #define DDR_REVERSED_P(DDR) DDR->reversed_p - -/* 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); - -bool get_references_in_stmt (gimple, VEC (data_ref_loc, heap) **); bool dr_analyze_innermost (struct data_reference *, struct loop *); extern bool compute_data_dependences_for_loop (struct loop *, bool, VEC (loop_p, heap) **, @@ -395,23 +377,13 @@ extern bool compute_data_dependences_for extern bool compute_data_dependences_for_bb (basic_block, bool, VEC (data_reference_p, heap) **, VEC (ddr_p, heap) **); -extern void print_direction_vector (FILE *, lambda_vector, int); -extern void print_dir_vectors (FILE *, VEC (lambda_vector, heap) *, int); -extern void print_dist_vectors (FILE *, VEC (lambda_vector, heap) *, int); -extern void dump_subscript (FILE *, struct subscript *); -extern void dump_ddrs (FILE *, VEC (ddr_p, heap) *); -extern void dump_dist_dir_vectors (FILE *, VEC (ddr_p, heap) *); +extern void debug_ddrs (VEC (ddr_p, heap) *); extern void dump_data_reference (FILE *, struct data_reference *); extern void debug_data_reference (struct data_reference *); -extern void dump_data_references (FILE *, VEC (data_reference_p, heap) *); extern void debug_data_references (VEC (data_reference_p, heap) *); extern void debug_data_dependence_relation (struct data_dependence_relation *); -extern void dump_data_dependence_relation (FILE *, - struct data_dependence_relation *); extern void dump_data_dependence_relations (FILE *, VEC (ddr_p, heap) *); extern void debug_data_dependence_relations (VEC (ddr_p, heap) *); -extern void dump_data_dependence_direction (FILE *, - enum data_dependence_direction); extern void free_dependence_relation (struct data_dependence_relation *); extern void free_dependence_relations (VEC (ddr_p, heap) *); extern void free_data_ref (data_reference_p); @@ -567,9 +539,7 @@ typedef struct rdg_vertex #define RDG_MEM_WRITE_STMT(RDG, I) RDGV_HAS_MEM_WRITE (&(RDG->vertices[I])) #define RDG_MEM_READS_STMT(RDG, I) RDGV_HAS_MEM_READS (&(RDG->vertices[I])) -void dump_rdg_vertex (FILE *, struct graph *, int); void debug_rdg_vertex (struct graph *, int); -void dump_rdg_component (FILE *, struct graph *, int, bitmap); void debug_rdg_component (struct graph *, int); void dump_rdg (FILE *, struct graph *); void debug_rdg (struct graph *); Index: gcc/tree-data-ref.c =================================================================== --- gcc/tree-data-ref.c (revision 185957) +++ gcc/tree-data-ref.c (working copy) @@ -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_referen 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, conf /* 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 subsc /* 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, lam /* 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 (la 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 *out 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 *fi 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 ( /* 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) 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_refer 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, h /* 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 /* 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, 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; -}