From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45110 invoked by alias); 9 Jun 2015 06:00:17 -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 45088 invoked by uid 89); 9 Jun 2015 06:00:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 09 Jun 2015 06:00:15 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Z2Ca3-0005dL-0D from Tom_deVries@mentor.com for gcc-patches@gcc.gnu.org; Mon, 08 Jun 2015 23:00:11 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.224.2; Tue, 9 Jun 2015 07:00:09 +0100 Message-ID: <557680DE.8050102@mentor.com> Date: Tue, 09 Jun 2015 07:47:00 -0000 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Thomas Schwinge CC: GCC Patches Subject: Re: [PING][PATCH][PR65443] Add transform_to_exit_first_loop_alt References: <551564D0.2090308@mentor.com> <551E8A1F.5050908@mentor.com> <552E69ED.7020601@mentor.com> <55548A19.3000302@mentor.com> <55700C12.9000801@mentor.com> <557571B5.1060903@mentor.com> <87twuigpo8.fsf@kepler.schwinge.homeip.net> <557611B6.3080809@mentor.com> In-Reply-To: <557611B6.3080809@mentor.com> Content-Type: multipart/mixed; boundary="------------030508070608050505090105" X-SW-Source: 2015-06/txt/msg00630.txt.bz2 --------------030508070608050505090105 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-length: 1619 On 09/06/15 00:05, Tom de Vries wrote: > On 08/06/15 17:55, Thomas Schwinge wrote: >> Hi Tom! >> >> On Mon, 8 Jun 2015 12:43:01 +0200, Tom de Vries >> wrote: >>> There are two problems in try_transform_to_exit_first_loop_alt: >>> 1. In case the latch is not a singleton bb, the function should return >>> false rather than true. >>> 2. The check for singleton bb should ignore debug-insns. >>> >>> Attached patch fixes these problems. >> >>> Fix try_transform_to_exit_first_loop_alt >> >>> PR tree-optimization/66442 >>> * gimple-iterator.h (gimple_seq_nondebug_singleton_p): Add function. >>> * tree-parloops.c (try_transform_to_exit_first_loop_alt): Return >>> false >>> if the loop latch is not a singleton. Use >>> gimple_seq_nondebug_singleton_p instead of gimple_seq_singleton_p. >> >> Per my testing, the backport of this patch that you committed to >> gomp-4_0-branch, r224219, introduces a number of regressions in your >> OpenACC kernels test cases, specifically the »scan-tree-dump-times >> parloops_oacc_kernels "(?n)pragma omp target >> oacc_parallel.*num_gangs\\(32\\)" 1« tests. Would you please have a >> look? >> >> > > Hi Thomas, > > I seem to have committed (to both trunk and gomp-4_0-branch) an older > version of the patch, which contained an incorrect version of > gimple_seq_nondebug_singleton_p. > > I'll correct the mistake tomorrow morning. Committed attached patch to trunk and propagated to gomp-4_0-branch. Committed as obvious, since it changes gimple_seq_nondebug_singleton_p into the tested and approved version. Thanks, - Tom --------------030508070608050505090105 Content-Type: text/x-patch; name="0001-Fix-gimple_seq_nondebug_singleton_p.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Fix-gimple_seq_nondebug_singleton_p.patch" Content-length: 1555 Fix gimple_seq_nondebug_singleton_p 2015-06-09 Tom de Vries * gimple-iterator.h (gimple_seq_nondebug_singleton_p): Don't always return false. --- gcc/gimple-iterator.h | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/gcc/gimple-iterator.h b/gcc/gimple-iterator.h index d08245e..76fa456 100644 --- a/gcc/gimple-iterator.h +++ b/gcc/gimple-iterator.h @@ -351,33 +351,27 @@ static inline bool gimple_seq_nondebug_singleton_p (gimple_seq seq) { gimple_stmt_iterator gsi; + + /* Find a nondebug gimple. */ gsi.ptr = gimple_seq_first (seq); gsi.seq = &seq; gsi.bb = NULL; - - /* Not a singleton if the sequence is empty. */ - if (gsi_end_p (gsi)) - return false; - - /* Find a nondebug gimple. */ while (!gsi_end_p (gsi) && is_gimple_debug (gsi_stmt (gsi))) gsi_next (&gsi); - /* Not a nondebug singleton if there's no nondebug gimple. */ - if (is_gimple_debug (gsi_stmt (gsi))) + /* No nondebug gimple found, not a singleton. */ + if (gsi_end_p (gsi)) return false; - /* Find the next nondebug gimple. */ + /* Find a next nondebug gimple. */ + gsi_next (&gsi); while (!gsi_end_p (gsi) && is_gimple_debug (gsi_stmt (gsi))) gsi_next (&gsi); - /* If there's a next nondebug gimple, it's not a nondebug singleton. */ - if (!gsi_end_p (gsi)) - return false; - - return true; + /* Only a singleton if there's no next nondebug gimple. */ + return gsi_end_p (gsi); } #endif /* GCC_GIMPLE_ITERATOR_H */ -- 1.9.1 --------------030508070608050505090105--