From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 9DFE93858D37 for ; Fri, 1 Sep 2023 06:34:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9DFE93858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 42C501F45E; Fri, 1 Sep 2023 06:34:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1693550065; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gueD/u6f/vZYW/LaZejMvx4OGK3FtXjlHF3LH6qrfSo=; b=HKKtZJCiTkFBpqc2ysWMT0tkC+Au6M0QiLR3kRUYlnctFsjS2JupqH+r8ckylTrEW2KJJ7 mr3UeGAga0nxMGoAvE/igEl5CV9uGnPt/2cjlbtA4KgYcuJ/9dD3lQRR+fE0pV8s1jwOcV PwHt+ElLa2l1k4rM+n6/pZmsWsYBUp4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1693550065; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gueD/u6f/vZYW/LaZejMvx4OGK3FtXjlHF3LH6qrfSo=; b=O6yZQBECo5bj1msY7o7taROS4dSJvcDe+g1BrsoBiCjMSSZS8LTDn2pSvvMjLsAAZQECW7 WgRliFjbqaToMSAA== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 3619D2C142; Fri, 1 Sep 2023 06:34:25 +0000 (UTC) Date: Fri, 1 Sep 2023 06:34:24 +0000 (UTC) From: Richard Biener To: Andrew Pinski cc: Filip Kastl , gcc-patches@gcc.gnu.org, hubicka@ucw.cz, jakub@redhat.com Subject: Re: [RFC] gimple ssa: SCCP - A new PHI optimization pass In-Reply-To: Message-ID: References: <084BC52B-00DE-4496-8B85-9211C3AD8394@suse.de> User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, 31 Aug 2023, Andrew Pinski wrote: > On Thu, Aug 31, 2023 at 5:15?AM Richard Biener via Gcc-patches > wrote: > > > > On Thu, 31 Aug 2023, Filip Kastl wrote: > > > > > > The most obvious places would be right after SSA construction and before RTL expansion. > > > > Can you provide measurements for those positions? > > > > > > The algorithm should only remove PHIs that break SSA form minimality. Since > > > GCC's SSA construction already produces minimal SSA form, the algorithm isn't > > > expected to remove any PHIs if run right after the construction. I even > > > measured it and indeed -- no PHIs got removed (except for 502.gcc_r, where the > > > algorithm managed to remove exactly 1 PHI, which is weird). > > > > > > I tried putting the pass before pass_expand. There isn't a lot of PHIs to > > > remove at that point, but there still are some. > > > > That's interesting. Your placement at > > > > NEXT_PASS (pass_cd_dce, false /* update_address_taken_p */); > > NEXT_PASS (pass_phiopt, true /* early_p */); > > + NEXT_PASS (pass_sccp); > > > > and > > > > NEXT_PASS (pass_tsan); > > NEXT_PASS (pass_dse, true /* use DR analysis */); > > NEXT_PASS (pass_dce); > > + NEXT_PASS (pass_sccp); > > > > isn't immediately after the "best" existing pass we have to > > remove dead PHIs which is pass_cd_dce. phiopt might leave > > dead PHIs around and the second instance runs long after the > > last CD-DCE. > > Actually the last phiopt is run before last pass_cd_dce: I meant the second instance of pass_sccp, not phiopt. Richard.