From patchwork Wed Mar 18 13:35:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 451461 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D076E140082 for ; Thu, 19 Mar 2015 00:35:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=bE89sBhW; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=jIAL6GVku+FlVve2EObVHbegEufXjqa+8kzKjHmbtZF0TxKu236ZF 3gEKOhr+SRPFPKpcJbqlB99g3kVV5/xfcW6e1eraoYTW9xT6uwXh4Wm8U2lEPVX6 qxZ93oL2hyReiSapY0jsL/mfBbEvaslu9AwVejAgKaE957RIjgp618= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=ho04BoTS2z0llD9Mvdx/J1BGot8=; b=bE89sBhWsqRrvCwYiTBs p+wKEGq7RNY7tyiCiZAHMAibjbcdNtOEYh/sPoynZPkTLkoQmU7xhSB1G+qRhXoc ormZqYE8tHzNCSDnBZlLH0MkskjTopJhFyElLeefZT/2PSsM+E6s/jHQfZno6BZ4 b7cMcCZcHHpKXhx6sF4XqAg= Received: (qmail 94858 invoked by alias); 18 Mar 2015 13:35:17 -0000 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 Received: (qmail 94847 invoked by uid 89); 18 Mar 2015 13:35:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Wed, 18 Mar 2015 13:35:15 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C5BE7AD53 for ; Wed, 18 Mar 2015 13:35:12 +0000 (UTC) Date: Wed, 18 Mar 2015 14:35:12 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Shrink data-ref Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 This removes dead code/data from tree-data-ref.h. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2015-03-18 Richard Biener * tree-data-ref.h (struct access_matrix): Remove. (AM_LOOP_NEST, AM_NB_INDUCTION_VARS, AM_PARAMETERS, AM_MATRIX, AM_NB_PARAMETERS, AM_CONST_COLUMN_INDEX, AM_NB_COLUMNS, AM_GET_SUBSCRIPT_ACCESS_VECTOR, AM_GET_ACCESS_MATRIX_ELEMENT): Likewise. (am_vector_index_for_loop): Likewise. (struct data_reference): Remove access_matrix member. (DR_ACCESS_MATRIX): Remove. (lambda_vector_new): Add comment. (lambda_matrix_new): Use XOBNEWVEC. Index: gcc/tree-data-ref.h =================================================================== --- gcc/tree-data-ref.h (revision 221411) +++ gcc/tree-data-ref.h (working copy) @@ -100,66 +100,7 @@ typedef int *lambda_vector; all vectors are the same length). */ typedef lambda_vector *lambda_matrix; -/* Each vector of the access matrix represents a linear access - function for a subscript. First elements correspond to the - leftmost indices, ie. for a[i][j] the first vector corresponds to - the subscript in "i". The elements of a vector are relative to - the loop nests in which the data reference is considered, - i.e. the vector is relative to the SCoP that provides the context - in which this data reference occurs. - - For example, in - - | loop_1 - | loop_2 - | a[i+3][2*j+n-1] - - if "i" varies in loop_1 and "j" varies in loop_2, the access - matrix with respect to the loop nest {loop_1, loop_2} is: - - | loop_1 loop_2 param_n cst - | 1 0 0 3 - | 0 2 1 -1 - - whereas the access matrix with respect to loop_2 considers "i" as - a parameter: - - | loop_2 param_i param_n cst - | 0 1 0 3 - | 2 0 1 -1 -*/ -struct access_matrix -{ - vec loop_nest; - int nb_induction_vars; - vec parameters; - vec *matrix; -}; - -#define AM_LOOP_NEST(M) (M)->loop_nest -#define AM_NB_INDUCTION_VARS(M) (M)->nb_induction_vars -#define AM_PARAMETERS(M) (M)->parameters -#define AM_MATRIX(M) (M)->matrix -#define AM_NB_PARAMETERS(M) (AM_PARAMETERS (M)).length () -#define AM_CONST_COLUMN_INDEX(M) (AM_NB_INDUCTION_VARS (M) + AM_NB_PARAMETERS (M)) -#define AM_NB_COLUMNS(M) (AM_NB_INDUCTION_VARS (M) + AM_NB_PARAMETERS (M) + 1) -#define AM_GET_SUBSCRIPT_ACCESS_VECTOR(M, I) AM_MATRIX (M)[I] -#define AM_GET_ACCESS_MATRIX_ELEMENT(M, I, J) AM_GET_SUBSCRIPT_ACCESS_VECTOR (M, I)[J] - -/* Return the column in the access matrix of LOOP_NUM. */ - -static inline int -am_vector_index_for_loop (struct access_matrix *access_matrix, int loop_num) -{ - int i; - loop_p l; - for (i = 0; AM_LOOP_NEST (access_matrix).iterate (i, &l); i++) - if (l->num == loop_num) - return i; - - gcc_unreachable (); -} struct data_reference { @@ -183,9 +124,6 @@ struct data_reference /* Alias information for the data reference. */ struct dr_alias alias; - - /* Matrix representation for the data access functions. */ - struct access_matrix *access_matrix; }; #define DR_STMT(DR) (DR)->stmt @@ -202,7 +140,6 @@ struct data_reference #define DR_STEP(DR) (DR)->innermost.step #define DR_PTR_INFO(DR) (DR)->alias.ptr_info #define DR_ALIGNED_TO(DR) (DR)->innermost.aligned_to -#define DR_ACCESS_MATRIX(DR) (DR)->access_matrix typedef struct data_reference *data_reference_p; @@ -560,6 +497,7 @@ lambda_vector_gcd (lambda_vector vector, static inline lambda_vector lambda_vector_new (int size) { + /* ??? We shouldn't abuse the GC allocator here. */ return ggc_cleared_vec_alloc (size); } @@ -611,11 +549,10 @@ lambda_matrix_new (int m, int n, struct lambda_matrix mat; int i; - mat = (lambda_matrix) obstack_alloc (lambda_obstack, - sizeof (lambda_vector *) * m); + mat = XOBNEWVEC (lambda_obstack, lambda_vector, m); for (i = 0; i < m; i++) - mat[i] = lambda_vector_new (n); + mat[i] = XOBNEWVEC (lambda_obstack, int, n); return mat; }