From patchwork Tue May 28 11:25:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 246833 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 277302C02B3 for ; Tue, 28 May 2013 21:25:48 +1000 (EST) 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=PL+OcBCLl1pdW1eRsOsyvBzP3py0uj/Hk4bCAxMJeZODRKgatVkuG +L2SOXC44qP7FN1bQJ9jO7CaDPuhrLr3U9lXwSCRbA3gXW1Pz66Dc81DpWHuYyau nupMjHyIn62jx8zSDFI6XKmSjW0SDfLVutIRwLs63ptlKRsLIe+R4w= 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=oi6KWllOQZnEOIwc1+2HDOBMBnw=; b=xw5FqDBI1G2JqcKe8bUm 67EqSgoZ6UmwsN4nsMZeZSPbQ0t/9n101zi2MA38i0TXzIxoeB2XGmE34RXW/xVt hucapShndHwxzpo0/DH28y49Vp30Bev6EqC7xsXTSxel2LTQCcmRnB8klJpwKzXN BqoFwdwvtuowEz5v46JRB5k= Received: (qmail 6897 invoked by alias); 28 May 2013 11:25:42 -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 6885 invoked by uid 89); 28 May 2013 11:25:41 -0000 X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 28 May 2013 11:25:35 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 8CEED543077; Tue, 28 May 2013 13:25:32 +0200 (CEST) Date: Tue, 28 May 2013 13:25:32 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, jakub@redhat.com, rth@redhat.com Subject: Make omp_expand to be part of lowering passes Message-ID: <20130528112532.GA19416@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Hi, I have hit problem with this pass several times. OMP is split into two passes, one run before CFG construction (lower_omp) and other after (expand_omp). Their purpose (as I understand it) is to outline part of the function body into child function. This happens in two steps and part of body (DECL_STRUCT_FUNCTION, some declarations etc) are built during lowering, while rest of body is build during expansion. For this reason we need quite few hacks in symbol table to not take the function body away (the child function appears not as declaration until late) and also omp code contains some ugly hacks with flags. According to dicussion with Jakub, I do not see reason why not move whole thing upwards into lowering. This make the child functio nto get throug optimization as a regular function and things works smoother. Bootstrapped/regtested x86_64, seem to make sense? Honza * passes.c (init_optimization_passes): Move expand_omp into late passes. Index: passes.c =================================================================== --- passes.c (revision 199343) +++ passes.c (working copy) @@ -1299,6 +1299,7 @@ init_optimization_passes (void) NEXT_PASS (pass_refactor_eh); NEXT_PASS (pass_lower_eh); NEXT_PASS (pass_build_cfg); + NEXT_PASS (pass_expand_omp); NEXT_PASS (pass_warn_function_return); NEXT_PASS (pass_build_cgraph_edges); *p = NULL; @@ -1312,7 +1313,6 @@ init_optimization_passes (void) struct opt_pass **p = &pass_early_local_passes.pass.sub; NEXT_PASS (pass_fixup_cfg); NEXT_PASS (pass_init_datastructures); - NEXT_PASS (pass_expand_omp); NEXT_PASS (pass_build_ssa); NEXT_PASS (pass_early_warn_uninitialized);