From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24973 invoked by alias); 8 Oct 2015 08:33:13 -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 24955 invoked by uid 89); 8 Oct 2015 08:33:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 08 Oct 2015 08:33:11 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49169) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1Zk6dR-0005eK-9d for gcc-patches@gnu.org; Thu, 08 Oct 2015 04:33:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zk6d1-0007Nr-2R for gcc-patches@gnu.org; Thu, 08 Oct 2015 04:33:08 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:34439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zk6d0-0007MV-Tu for gcc-patches@gnu.org; Thu, 08 Oct 2015 04:32:43 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Zk6cw-0007IA-HQ from Tom_deVries@mentor.com ; Thu, 08 Oct 2015 01:32:38 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Thu, 8 Oct 2015 09:32:37 +0100 Subject: [gomp4, committed] Add counter inits to zero_iter_bb in expand_omp_for_init_counts To: Jakub Jelinek References: <560D2B09.4020501@mentor.com> <20151001124933.GB28276@tucnak.redhat.com> <560D3716.9020804@mentor.com> CC: "gcc-patches@gnu.org" From: Tom de Vries Message-ID: <561629FD.4090908@mentor.com> Date: Thu, 08 Oct 2015 08:33:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <560D3716.9020804@mentor.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 X-SW-Source: 2015-10/txt/msg00798.txt.bz2 [ was: Re: [patch] Add counter inits to zero_iter_bb in expand_omp_for_init_counts ] On 01/10/15 15:37, Tom de Vries wrote: > On 01/10/15 14:49, Jakub Jelinek wrote: >> On Thu, Oct 01, 2015 at 02:46:01PM +0200, Tom de Vries wrote: >>> this patch adds initialization in zero_iter_bb of counters introduced in >>> expand_omp_for_init_counts. >>> >>> This removes the need to set TREE_NO_WARNING on those counters. >> >> Why do you think it is a good idea? > > In replace_ssa_name, I've recently added the assert: > ... > gcc_assert (!SSA_NAME_IS_DEFAULT_DEF (name)); > ... > > On the gomp-4_0-branch, this assert triggers for a collapsed acc loop, > which uses expand_omp_for_generic for omp-expansion. The assert > triggers because (some of) the counters added by > expand_omp_for_init_counts are not initialized on all paths. > > On trunk, for the test-case in the patch, this assert doesn't trigger > because the omp function is split off before ssa. > >> I'd be afraid it slows things down unnecessarily. > > I think zero_iter_bb is a block that is expected not to be executed > frequently. > > I've attached an sdiff of x86_64 assembly for the test-case (before > left, after right). AFAICT, this patch has the effect that it speeds up > the frequent path with one instruction. > >> Furthermore, I'd prefer not to change this area of code before >> gomp-4_1-branch is merged, as it will be a nightmare for the merge >> otherwise. > > Committing to gomp-4_0-branch for now would work for me. > Committed to gomp-4_0-branch. Thanks, - Tom