From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 5861F3858426 for ; Wed, 20 Oct 2021 19:53:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5861F3858426 Received: by mail-pl1-x62d.google.com with SMTP id g5so16911724plg.1 for ; Wed, 20 Oct 2021 12:53:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=UHAgeOlDFnRPXlgLXf2JhIyoFXpBfcWhAklPo8c1IIE=; b=TKWMIE3A+sYfVkoIVmv+ZLWFCl62/7eDjgjJP9hxo5PLLWSssZesDm8Rz9KsQbws5z A+E38fK6N2+vC9oko7oNfDPITTCxhDVga2uSj0Q8yxPFIq5sJYF04zmH4ZXP8iB3yqkq Seeng4taA1lQDhX53sEJN2vKaSr35cla6wOUxIYAh0vXHPN7vG7DPpfq9AE25ooSgpvJ 2+dRUNJb9rd1tpJ9W4DU3XbAoJifT6lM11PJmRvdJ61xI+aOv8P55ev5VIOzYJnWhNXk ZyflO0egfqvfm8ESuxBi10OdupnC14xPJLOg2YZ1x6a4EAs70pXoJwt+raHY2oF461UP DRug== X-Gm-Message-State: AOAM531Zi6vkb6uwM0KdJxFfs8R7OeoEnPa3TVnOf/iO51YMKrqKjWUo QQLp4u2ZU1s0OkXa+mrYUmRkE+utqWQ= X-Google-Smtp-Source: ABdhPJzXZV5Rm0HViJkDL1OtM5/hpCscSqEBlNzg0bAIIGN/LuTgO0xIUr4X1SAcY44TxNdkRCIE/w== X-Received: by 2002:a17:90b:3a88:: with SMTP id om8mr1166776pjb.71.1634759615244; Wed, 20 Oct 2021 12:53:35 -0700 (PDT) Received: from [192.168.1.24] (65-130-88-192.slkc.qwest.net. [65.130.88.192]) by smtp.gmail.com with ESMTPSA id oa1sm7399456pjb.6.2021.10.20.12.53.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Oct 2021 12:53:34 -0700 (PDT) Subject: Re: [PATCH 4/4] Improve maybe_remove_writeonly_store to do a simple DCE for defining statement To: Richard Biener Cc: Andrew Pinski , GCC Patches 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> From: Jeff Law Message-ID: Date: Wed, 20 Oct 2021 13:53:32 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, 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:53:38 -0000 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? Jeff