From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x933.google.com (mail-ua1-x933.google.com [IPv6:2607:f8b0:4864:20::933]) by sourceware.org (Postfix) with ESMTPS id 8EEEB3858409 for ; Wed, 20 Oct 2021 19:57:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8EEEB3858409 Received: by mail-ua1-x933.google.com with SMTP id r22so8836808uat.11 for ; Wed, 20 Oct 2021 12:57:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ThqnQRsdXFfAWcMQ8XymqT5f7WfeYLwHuLstJ+6jzXA=; b=eSZd7hSc3X1qDRA7/CrUZsiVwcwALvY0MyMmkxGaSZa9VftdNHPQTRxUMu4iNK12TF cbbcDWj/l22eCLBUd2+keqHvBnMMw/i+c8QwcBdxl1YwyXftWfzwTL7tayoIAuPJO+yh XbaYa0bHl7FGSxmof5TWHZy51vlFfhksiBgldcYBdttAy89fB9qAp9D336ulK2bJR2eO YTsf6eD6pCMPfsm3P4S+MVyj1UVYZBWVwW4resEVZf1NFOTd8PpejLHpFOzLrAjKB05Y dm68swTJR8kd8bDCbof5QzRToGPLcuiL1/SZOx9AjLs5L329Y+9K19su/GsoSNXrMYG6 iuHw== X-Gm-Message-State: AOAM5322awFCXAKnp8sRRf3XL1SfZeEkAV2X5WJz4hpMqgz0Rss3gRHQ l5wmBU5hi6Xs/UXER2ZVSK0OWUZEYwNVUMVAhpI= X-Google-Smtp-Source: ABdhPJzAFabL+91bhYf6o9bfoD/ktpabP3zldUts3ZbMAWP7/Wh64zBm6iL7JhMloUuBiXl4XZDlS9v7//Dzbbrz1bU= X-Received: by 2002:a67:cb04:: with SMTP id b4mr1528068vsl.17.1634759844182; Wed, 20 Oct 2021 12:57:24 -0700 (PDT) MIME-Version: 1.0 References: <1634619244-18969-1-git-send-email-apinski@marvell.com> <1634619244-18969-5-git-send-email-apinski@marvell.com> <8fad2c2f-220f-b06a-6481-1dc8f250e3fe@gmail.com> In-Reply-To: From: Andrew Pinski Date: Wed, 20 Oct 2021 12:57:11 -0700 Message-ID: Subject: Re: [PATCH 4/4] Improve maybe_remove_writeonly_store to do a simple DCE for defining statement To: Jeff Law Cc: Richard Biener , Andrew Pinski , GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Oct 2021 19:57:25 -0000 On Wed, Oct 20, 2021 at 12:54 PM Jeff Law via Gcc-patches wrote: > > > > On 10/20/2021 12:58 AM, Richard Biener wrote: > > On Wed, Oct 20, 2021 at 1:14 AM Jeff Law via Gcc-patches > > wrote: > >> > >> > >> On 10/18/2021 10:54 PM, apinski--- via Gcc-patches wrote: > >>> From: Andrew Pinski > >>> > >>> Instead of putting a full blow DCE after execute_fixup_cfg, it makes sense > >>> to try to remove the defining statement for the store that is being removed. > >>> Right now we only handle PHI node statements as there needs no extra checks > >>> except for it is only used once in the store statement. > >>> > >>> gcc/ChangeLog: > >>> > >>> * tree-cfg.c (maybe_remove_writeonly_store): Remove defining > >>> (PHI) statement of the store if possible. > >> This is the only part that I consider at all controversial. > >> > >> Is the case you're trying to handle such that you have to eliminate the > >> PHI immediately and can't wait until the next DCE pass? > >> > >> If so and we want to go this direction, should we pull this out into a > >> little routine? I'm a bit surprised we don't already have one or more > >> that do basically the same thing. > > We have simple_dce_from_worklist for this which you'd seed with > > the SSA rhs of the removed stores. > Yea, that seems like a better routine to use. Andrew, can you try that? Yes that is a better routine to use, the patch is in testing right now. I should be able to submit it in a few hours. Thanks, Andrew > Jeff