From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12732 invoked by alias); 9 Dec 2015 08:31:51 -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 12720 invoked by uid 89); 9 Dec 2015 08:31:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 09 Dec 2015 08:31:45 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id A8571C0B023A; Wed, 9 Dec 2015 08:31:43 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-32.phx2.redhat.com [10.3.113.32]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB98Vhve031537; Wed, 9 Dec 2015 03:31:43 -0500 Subject: Re: [RFA] [PATCH] [PR tree-optimization/68619] Avoid direct cfg cleanups in tree-ssa-dom.c [1/3] To: Richard Biener References: <56667585.5040307@redhat.com> Cc: gcc-patches From: Jeff Law Message-ID: <5667E6EE.1060802@redhat.com> Date: Wed, 09 Dec 2015 08:31: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=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00956.txt.bz2 On 12/08/2015 07:27 AM, Richard Biener wrote: >> >> I wonder if it makes more sense to integrate this with the >> domwalker itself. Add a constructor flag to it and do everything >> in itself. By letting the before_dom_children return a taken edge >> (or NULL if unknown) it can drive the outgoing edge marking. And >> the domwalk worker would simply not recurse to dom children for >> unreachable blocks. > > So interface-wise do [ ... ] Close :-) If skip_unreachable_blocks is true, then we want the walker to initialize EDGE_EXECUTABLE automatically. So we drop the member initialization and constructor body from domwalk.h and instead have a ctor in domwalk.c where we can initialize the private members and set EDGE_EXECUTABLE as needed. My first iteration let the clients clear EDGE_EXECUTABLE as they found conditionals that could be optimized. That was pretty clean and localized in sccvn & dom. If we have the before_dom_children return the taken edge, then we have to twiddle all the clients due to the api change in before_dom_children. . There's ~18 in total, so it's not too bad. 2 of the 18 clearly need to use the skip_unreachable_blocks capability (dom and sccvn). 2 others might be able to use it (tree-ssa-pre.c and tree-ssa-propagate.c) I converted dom and sccvn, but not pre and the generic propagation engine. I can submit the iteration which lets clients clear EDGE_EXECUTABLE, or the iteration where the clients return the taken edge (or NULL) from the before_dom_children callback. Either is fine with me, so if you have a preference, let me know. jeff