From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45517 invoked by alias); 17 Nov 2015 15:39:19 -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 45429 invoked by uid 89); 17 Nov 2015 15:39:19 -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,RP_MATCHES_RCVD,SPF_PASS 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; Tue, 17 Nov 2015 15:39:18 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44374) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ZyiLj-0003OJ-K2 for gcc-patches@gnu.org; Tue, 17 Nov 2015 10:39:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyiLf-0004XM-68 for gcc-patches@gnu.org; Tue, 17 Nov 2015 10:39:15 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:50814) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyiLf-0004XC-0h for gcc-patches@gnu.org; Tue, 17 Nov 2015 10:39:11 -0500 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 1ZyiLd-0005vB-Cr from Tom_deVries@mentor.com ; Tue, 17 Nov 2015 07:39:09 -0800 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; Tue, 17 Nov 2015 15:39:08 +0000 Subject: Re: [PATCH, 10/16] Add pass_oacc_kernels pass group in passes.def To: Richard Biener References: <5640BD31.2060602@mentor.com> <5640FB07.6010008@mentor.com> <5649C41A.40403@mentor.com> <564A64B3.7080305@mentor.com> <564B3F69.50600@mentor.com> CC: Richard Biener , "gcc-patches@gnu.org" , Jakub Jelinek From: Tom de Vries Message-ID: <564B49F6.308@mentor.com> Date: Tue, 17 Nov 2015 15:39:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; 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-11/txt/msg02106.txt.bz2 On 17/11/15 16:18, Richard Biener wrote: >>> IMHO autopar needs to handle induction itself. >> > >> >I'm not sure what you mean. Could you elaborate? Autopar handles induction >> >variables, but it doesn't handle exit phis reading the final value of the >> >induction variable. Is that what you want fixed? How? > Yes. Perform final value replacement. > I see. Calling scev_const_prop in pass_parallelize_loops_oacc_kernels seems to work fine. Doing the same for pass_parallelize_loops like this: ... diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 17415a8..d944395 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -2787,6 +2787,9 @@ pass_parallelize_loops::execute (function *fun) if (number_of_loops (fun) <= 1) return 0; + unsigned int sccp_todo = scev_const_prop (); + gcc_assert (sccp_todo == 0); + if (parallelize_loops ()) { fun->curr_properties &= ~(PROP_gimple_eomp); ... seems to fix PR 68373 - "autopar fails on loop exit phi with argument defined outside loop". The new scev_const_prop call in autopar rewrites this phi into an assignment, and that allows parloops to succeed: ... final value replacement: n_2 = PHI with n_2 = n_4(D); ... Thanks, - Tom