From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 58F623858423 for ; Tue, 19 Oct 2021 23:13:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 58F623858423 Received: by mail-pf1-x430.google.com with SMTP id q19so1302879pfl.4 for ; Tue, 19 Oct 2021 16:13:07 -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:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=L7dMmlLVDXu0wSJXKu/ndkNj1dCafjGRk+ppSFljUcY=; b=JS5yTVSvCd6trquzCJdsVgWSvERWB9Y6ZCW7/Tl5UTW+aYBFMHEobr5Y8k0KmdvO6B DGu0dUMUjXlPhX7mrwUNYpEmKj2B2yXVi5IgZT0OIeVgdoq+inp8vgXmyixyTnQQj4Tw 7xYoG1UVBRLATHdZ9XXhSBnCsqZTnHZmb4Qeh2gMRaq0+ob90W2xUq1SWu5UdfhS+U10 pDyb5xoxTjyLFWAKSYfkkgfWI/Hb4czUQHqtaNNxdYoCtjYxmPS27K8iZdpDy9flqDvy L+VMjO7iPjkjnsn2UecRJrj/i98AUG0lrbS+E22RNPIA4iyES2p7tCHfQU1AvYbzM/s1 nwpw== X-Gm-Message-State: AOAM530zAFKB5Y7AombUrc7Ep/2WtlTC9+MYnROrA/+W348Hy+tiCI5F X/AiL/3++UtPqJY/h/i0mDBd5FMqMGc= X-Google-Smtp-Source: ABdhPJyIRFXCmY6BsxzWRl0RWjSBKYG3KvV0vdSsCJsPy2baJGDLjSxhdZ6Q2rg/3Aww0AWO1SaGyg== X-Received: by 2002:a63:bf45:: with SMTP id i5mr30634918pgo.161.1634685186223; Tue, 19 Oct 2021 16:13:06 -0700 (PDT) Received: from [172.31.0.175] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id x7sm281183pfj.28.2021.10.19.16.13.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Oct 2021 16:13:05 -0700 (PDT) Subject: Re: [PATCH 4/4] Improve maybe_remove_writeonly_store to do a simple DCE for defining statement To: apinski@marvell.com, gcc-patches@gcc.gnu.org References: <1634619244-18969-1-git-send-email-apinski@marvell.com> <1634619244-18969-5-git-send-email-apinski@marvell.com> From: Jeff Law Message-ID: <8fad2c2f-220f-b06a-6481-1dc8f250e3fe@gmail.com> Date: Tue, 19 Oct 2021 17:13:05 -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: <1634619244-18969-5-git-send-email-apinski@marvell.com> 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: Tue, 19 Oct 2021 23:13:10 -0000 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. Jeff