From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21021 invoked by alias); 30 Oct 2015 12:36:59 -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 21011 invoked by uid 89); 30 Oct 2015 12:36:58 -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,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f174.google.com Received: from mail-yk0-f174.google.com (HELO mail-yk0-f174.google.com) (209.85.160.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 30 Oct 2015 12:36:56 +0000 Received: by ykek133 with SMTP id k133so74250738yke.2 for ; Fri, 30 Oct 2015 05:36:54 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.129.155.130 with SMTP id s124mr5986026ywg.68.1446208614646; Fri, 30 Oct 2015 05:36:54 -0700 (PDT) Received: by 10.37.117.136 with HTTP; Fri, 30 Oct 2015 05:36:54 -0700 (PDT) In-Reply-To: <871tccwo2g.fsf@e105548-lin.cambridge.arm.com> References: <87a8r0wqoe.fsf@e105548-lin.cambridge.arm.com> <871tccwo2g.fsf@e105548-lin.cambridge.arm.com> Date: Fri, 30 Oct 2015 12:44:00 -0000 Message-ID: Subject: Re: Try to update dominance info in tree-call-cdce.c From: Richard Biener To: Richard Biener , GCC Patches , richard.sandiford@arm.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg03383.txt.bz2 On Fri, Oct 30, 2015 at 1:14 PM, Richard Sandiford wrote: > Richard Biener writes: >> On Fri, Oct 30, 2015 at 12:18 PM, Richard Sandiford >> wrote: >>> The pass would free the dominance info after making a change, but it >>> should be pretty easy to keep the information up-to-date when the call >>> has no EH edges. In a way the main hurdle was split_block, which seemed >>> to assume that the new block would postdominate the old one, and that >>> all blocks immediately dominated by the old block are now immediately >>> dominated by the new one. >>> >>> Tested on x86_64-linux-gnu, arm-linux-gnueabi and aarch64-linux-gnu. >>> OK to install? >> >> Hmm, I don't understand why split_block needs to be touched. The >> operation itself correctly updates dominator info. It is up to the >> pass to fix things up if it does further CFG modifications that make >> the new block no longer post-dominate the old one. >> >> So why do you need the split_block change? > > The updates we'd need here would be: > > redirect_immediate_dominators (CDI_DOMINATORS, call, guard_bb); > > which undoes the earlier: > > redirect_immediate_dominators (CDI_DOMINATORS, guard_bb, call); > > that split_block did. It just seemed wasteful to call > redirect_immediate_dominators twice to get a no-op. > > In other words, there are going to be callers to split_block that > know the second block isn't going to postdominate the first and > where the calling; > > redirect_immediate_dominators (CDI_DOMINATORS, first_block, > second_block); > > is taking us further from where we want to be. That's true. In an ideal world we'd have a CFG hook creating a (half) diamond directly. I wonder how other passes work around this issue? I suppose they are splitting the block to form the conditonal block and the joiner? If you have those and then only split the fallthru edge between them the redundant work done is minimal. Richard. > Thanks, > Richard >