From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by sourceware.org (Postfix) with ESMTPS id 36DBF3858C3A for ; Wed, 20 Oct 2021 06:58:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 36DBF3858C3A Received: by mail-ed1-x532.google.com with SMTP id i20so22009490edj.10 for ; Tue, 19 Oct 2021 23:58:55 -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=wJy8B0Uf+24shBvuw3LVnMoY1S6tVbQb3IGjsBVFqQs=; b=5PE9yaF3T9yfksZnk/IGDACg4YlafnazABZZqjvsp7wUcIm34DAUbGquCublFdOLfd EuCQhR+jrPs+BzjmQbvBVpbj9nGTTup1U6V5XjMhYIyiNDeNEGUY7n4275ylj1h2WnAa QiOt58sW8LenbY3sIWgAHtcKMaAB8x6lDv2883iIcUgwgWwKYTiSwqzw6g7u3CadiO14 8WzuXxd162CdEZZssMAI9nOrD22Z5yJDGr9FBnai2KuSv+qrDE9pVFULTVCgev5wnBAn cTyKzVPu/BcsYJMppvRSdnd2s6ifDFJnn5/jQssWOe1PmZnuijerDH5BCBG9ZP3EXLQI PPQQ== X-Gm-Message-State: AOAM533+iw5Nwg55C4mPRiQcLfy2YXhGETxMN8BcBt9Mq64dCL3ckidD mgSoFLM5QUckDiV/X+CaRZQEt+fVupM7VBNt8UY= X-Google-Smtp-Source: ABdhPJwpWHy9ctedRhJLQprxzSAhl63oI83C1axc8m0yWXSAF8tMIVGBBAGqPEX/pGKJSVgYo4Wgbrje2+Q3+3QeRC4= X-Received: by 2002:a17:906:b311:: with SMTP id n17mr42108013ejz.571.1634713133367; Tue, 19 Oct 2021 23:58:53 -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: <8fad2c2f-220f-b06a-6481-1dc8f250e3fe@gmail.com> From: Richard Biener Date: Wed, 20 Oct 2021 08:58:42 +0200 Message-ID: Subject: Re: [PATCH 4/4] Improve maybe_remove_writeonly_store to do a simple DCE for defining statement To: Jeff Law Cc: Andrew Pinski , GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.3 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 06:58:56 -0000 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. Richard. > > Jeff >