From patchwork Sun Nov 8 21:56:55 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: 541493 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 6A7191413F4 for ; Mon, 9 Nov 2015 08:57:38 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=aYSeBcN6; 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:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=ZtDk+GFIXEzlJH4Ue4qSiNmzo549dduOWT8hijBpMT3LcYwXhH 8uLvTEwXRvrCIxPlwHU0qcxz3sctcmCcyo/xG4XGC+krM06WDfDKCnQvPq0nAvGD la5vjRkOveaTiUSpVBHHQLwyV8W/VgE9pQbN1rSqHKzVhxNBmcSWrwTRE= 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:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=r51zkNDTsrc4qMGKPtz4Fjz8K+Y=; b=aYSeBcN6X507w7PVQXb+ J/Z3AgrYc+UvLUF7ZCff+aMUAoLQwSWR3nMoHF9uU5uWtm3BVcY4dodCXIFkNF9n na90OITIrgSMQNlmIKQeT0z8V7nY25zYH0lz3MHfvpe5FzzcdAwW00cUvRVtaotc RzKwPjFKteCPDoMJLFPCufk= Received: (qmail 76792 invoked by alias); 8 Nov 2015 21:57:29 -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 76779 invoked by uid 89); 8 Nov 2015 21:57:28 -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; Sun, 08 Nov 2015 21:57:27 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51836) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ZvXxl-00085N-IP for gcc-patches@gnu.org; Sun, 08 Nov 2015 16:57:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvXxi-0001xK-1H for gcc-patches@gnu.org; Sun, 08 Nov 2015 16:57:25 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:44585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvXxh-0001xG-RQ for gcc-patches@gnu.org; Sun, 08 Nov 2015 16:57:21 -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 1ZvXxh-0003T1-2m from Tom_deVries@mentor.com ; Sun, 08 Nov 2015 13:57:21 -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; Sun, 8 Nov 2015 21:57:16 +0000 To: "gcc-patches@gnu.org" CC: Jakub Jelinek From: Tom de Vries Subject: [gomp4, committed] Add dominator_base::may_peel_loop_headers_p Message-ID: <563FC527.3020908@mentor.com> Date: Sun, 8 Nov 2015 22:56:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 Hi, This patch eliminates the first_pass_instance test in dominator_base::execute, and introduces a virtual function dominator_base::may_peel_loop_headers_p that is tested instead. This allows us to choose may_peel_loop_headers_p == false for pass_dominator_oacc_kernels. Thanks, - Tom Add dominator_base::may_peel_loop_headers_p 2015-11-08 Tom de Vries * tree-ssa-dom.c (dominator_base::may_peel_loop_headers_p) (pass_dominator::may_peel_loop_headers_p) (pass_dominator_oacc_kernels::may_peel_loop_headers_p):: New function. (dominator_base::execute): Use may_peel_loop_headers_p. --- gcc/tree-ssa-dom.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index 10110d7..a2abb8e 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -529,6 +529,8 @@ class dominator_base : public gimple_opt_pass unsigned int execute (function *); + protected: + virtual bool may_peel_loop_headers_p (void) { return true; } }; // class dominator_base const pass_data pass_data_dominator = @@ -554,6 +556,9 @@ public: /* opt_pass methods: */ opt_pass * clone () { return new pass_dominator (m_ctxt); } virtual bool gate (function *) { return flag_tree_dom != 0; } + + protected: + virtual bool may_peel_loop_headers_p (void) { return first_pass_instance; } }; // class pass_dominator unsigned int @@ -629,7 +634,7 @@ dominator_base::execute (function *fun) free_all_edge_infos (); /* Thread jumps, creating duplicate blocks as needed. */ - cfg_altered |= thread_through_all_blocks (first_pass_instance); + cfg_altered |= thread_through_all_blocks (may_peel_loop_headers_p ()); if (cfg_altered) free_dominance_info (CDI_DOMINATORS); @@ -736,6 +741,9 @@ public: private: bitmap m_regions; + + protected: + virtual bool may_peel_loop_headers_p (void) { return false; } }; // class pass_dominator_oacc_kernels } // anon namespace -- 1.9.1