From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53192 invoked by alias); 19 Jun 2017 13:34:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 51121 invoked by uid 89); 19 Jun 2017 13:34:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_1,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=collects, H*i:sk:CAFiYyc, life X-HELO: mail-vk0-f50.google.com Received: from mail-vk0-f50.google.com (HELO mail-vk0-f50.google.com) (209.85.213.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Jun 2017 13:34:24 +0000 Received: by mail-vk0-f50.google.com with SMTP id 191so51645527vko.2 for ; Mon, 19 Jun 2017 06:34:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=3XWmmUqlPYAzT5uAFCQFcyj1Jsw5JkDZTvr9c0VYHdo=; b=anUIyeEMY5Budk3GjrkTY2eoc0lWSgKTRHAuN2Us+JzcqKGqNHlADI9MN5LrQjum59 iQkfsm0VPWeAY5QtrZt0Li6xaQ0GNrrKsRSngQ8m7ZhjuDIziA81Ss5UJqgRnjxoiJZg frHc2Tf7TInZT5x6cgwYUCh+tMraCOYJfxgQRss9gJbWG/Ec7w0d+jeo1kdShTOlSARy CKHhLydkH4CVrREwZ0LKIAg3wPeUN8np9IJrn9VQN608id0hhFPJJpKW7SwYx1yyNK+7 TEyqqe0d7yOfHcWhLM29YGZwyS1b2hJ4AlqtWyEtjVqLq0Z5uUbSo4EJ1KpWlP02dZlr 5YZA== X-Gm-Message-State: AKS2vOwAnXvl6ohTbAS02yXFv5EOgzIqF4/9fX3Rf84X6vH/IfNfRhCi OwJC4L50zY4V2sX6FyX2gWZ5O7CKxxGS X-Received: by 10.31.84.4 with SMTP id i4mr13311819vkb.142.1497879267844; Mon, 19 Jun 2017 06:34:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.49.142 with HTTP; Mon, 19 Jun 2017 06:34:27 -0700 (PDT) In-Reply-To: References: From: "Bin.Cheng" Date: Mon, 19 Jun 2017 13:34:00 -0000 Message-ID: Subject: Re: [PATCH GCC][07/13]Preserve data references for whole distribution life time To: Richard Biener Cc: "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg01303.txt.bz2 On Tue, Jun 13, 2017 at 12:14 PM, Richard Biener wrote: > On Mon, Jun 12, 2017 at 7:02 PM, Bin Cheng wrote: >> Hi, >> This patch collects and preserves all data references in loop for whole >> distribution life time. It will be used afterwards. >> >> Bootstrap and test on x86_64 and AArch64. Is it OK? > > +/* Vector of data references in the loop to be distributed. */ > +static vec *datarefs_vec; > + > +/* Map of data reference in the loop to a unique id. */ > +static hash_map *datarefs_map; > + > > no need to make those pointers. It's not a unique id but > the index into the datarefs_vec vector, right? > > loop distribution doesn't yet use dr->aux so it would be nice > to avoid the hash_map in favor of using that field. > > #define DR_INDEX (dr) ((uintptr_t)(dr)->aux) > > + if (datarefs_vec->length () > 64) > > There is PARAM_VALUE (PARAM_LOOP_MAX_DATAREFS_FOR_DATADEPS) > with a default value of 1000. Please use that instead of magic numbers. > > + { > + if (dump_file && (dump_flags & TDF_DETAILS)) > + fprintf (dump_file, > + "Loop %d not distributed: more than 64 memory references.\n", > + loop->num); > + > + free_rdg (rdg); > + loop_nest->release (); > + delete loop_nest; > + free_data_refs (*datarefs_vec); > + delete datarefs_vec; > + return 0; > + } > > auto_* were so nice ... Hi Richard, This is the updated patch. It removes datarefs_map as well as checks number of data references against the parameter. Is it OK? Thanks, bin 2017-06-07 Bin Cheng * tree-loop-distribution.c (params.h): Include header file. (MAX_DATAREFS_NUM, DR_INDEX): New macro. (datarefs_vec): New global var. (create_rdg_vertices): Use datarefs_vec directly. (free_rdg): Don't free data references. (build_rdg): Update use. Don't free data references. (distribute_loop): Compute global variable for data references. Bail out if there are too many data references.