From patchwork Fri Mar 13 10:32:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 449906 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 84A191400EA for ; Fri, 13 Mar 2015 21:32:19 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=In4/GA5k; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=HU8DWWXRZmJ491Q3LRZ9p1DzAEs+LhjcdrK59HjV/igF+5 myuJ4W8TrcTerjCt0S4A/LRW/TZ4/FfmEt3/bxwUakVw04+MIHRTU6QCfLDmc/Sc sKKEPhx/gS4G76IHLSpq8gFkrQ4F6N2mJvfMoTWFXNvQ6mYi497vaJNsQNFmU= 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 :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=FzEkdRqhcGczCG46uZW5bU94uWQ=; b=In4/GA5khnfDAjZ42yu8 UiPSyjfaVwtXhakg9pTa+NqXBwVRDxTos7tny8LimUL42/OGzQuP5mgNLXREM+Qk w4PuYTSxJqjlx9jEYOW4L9WnzvLfjeL8DwQDCZouOe0MFEFcKUl5JAiVglq5s4U2 yqnBk1lA5wBzGEA8I2/3f0U= Received: (qmail 116917 invoked by alias); 13 Mar 2015 10:32:13 -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 116903 invoked by uid 89); 13 Mar 2015 10:32:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 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; Fri, 13 Mar 2015 10:32:10 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-04.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1YWMsw-0004BL-Bc from Tom_deVries@mentor.com for gcc-patches@gcc.gnu.org; Fri, 13 Mar 2015 03:32:06 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-04.mgc.mentorg.com (137.202.0.110) with Microsoft SMTP Server id 14.3.224.2; Fri, 13 Mar 2015 10:32:04 +0000 Message-ID: <5502BCA2.2010802@mentor.com> Date: Fri, 13 Mar 2015 11:32:02 +0100 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: GCC Patches Subject: [PATCH, stage1] Make parloops gate more strict Hi, this patch moves a bunch of early-out tests from the parloops pass to the gate function. The only effect is for functions that we don't consider at all for parallelization in the parloops pass. We no longer dump those in the parloops dump file. Bootstrapped and reg-tested on x86_64. OK for stage1 trunk? Thanks, - Tom 2015-03-10 Tom de Vries * tree-parloops.c (parallelize_loops): Move early-out tests from here ... (pass_parallelize_loops::execute): ... and here ... (pass_parallelize_loops::gate): ... to here. diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 5f7c1bc..3a80cea 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -2163,12 +2163,6 @@ parallelize_loops (void) HOST_WIDE_INT estimated; source_location loop_loc; - /* Do not parallelize loops in the functions created by parallelization. */ - if (parallelized_function_p (cfun->decl)) - return false; - if (cfun->has_nonlocal_label) - return false; - gcc_obstack_init (&parloop_obstack); reduction_info_table_type reduction_list (10); init_stmt_vec_info_vec (); @@ -2286,7 +2280,15 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tree_parallelize_loops > 1; } + virtual bool gate (function *fun) + { + return (flag_tree_parallelize_loops > 1 + /* Do not parallelize loops in the functions created by + parallelization. */ + && !parallelized_function_p (fun->decl) + && !fun->has_nonlocal_label + && number_of_loops (fun) > 1); + } virtual unsigned int execute (function *); }; // class pass_parallelize_loops @@ -2294,9 +2296,6 @@ public: unsigned pass_parallelize_loops::execute (function *fun) { - if (number_of_loops (fun) <= 1) - return 0; - if (parallelize_loops ()) { fun->curr_properties &= ~(PROP_gimple_eomp); -- 1.9.1