From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75403 invoked by alias); 18 Dec 2019 09:59:11 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 75394 invoked by uid 89); 18 Dec 2019 09:59:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-vk1-f196.google.com Received: from mail-vk1-f196.google.com (HELO mail-vk1-f196.google.com) (209.85.221.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Dec 2019 09:59:09 +0000 Received: by mail-vk1-f196.google.com with SMTP id i78so477190vke.0 for ; Wed, 18 Dec 2019 01:59:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+yK+crtJYSZbciK0aZJYxsLIrjUXVHFTDTpuuw4tLFE=; b=luA+ll8kJWS3hZDdceamXsVOzU89JXYwdlxwMSyRUTCPjAgAas7pWFu7T5FPvdHM0Z ouT0WLw0vMQ3t81ZjVTYtd3d2uFkXS4Nt5q3CcBGIea24ESu3CN9/GHOzyAGT352GPzh 2JUZYQistIiwn3kH1eW4QT3kOaBjgIArcjCAvUZAbHulBnYbbR/Q0P3K4f24MibiTt9u 0XzGHf2rIrIR7dfXmbp+uIUdTvAezV02FWrExQSYNlt6MIbrllpjEVF4TzhY7cPENZ08 rAgMmnU1lzG7EtBk5BQtuKU3i4Q7aOq3Ya0zZ4knwgIZ9P4zW1XVH4vl8iocHrwppxoZ wVXg== MIME-Version: 1.0 References: <20191218082600.GT3152@gate.crashing.org> In-Reply-To: From: Andrew Pinski Date: Wed, 18 Dec 2019 10:24:00 -0000 Message-ID: Subject: Re: [PATCH] Fix redundant load missed by fre [tree-optimization 92980] To: Hongtao Liu Cc: Segher Boessenkool , Richard Biener , GCC Patches , "H. J. Lu" , wwwhhhyyy333@gmail.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-12/txt/msg01282.txt.bz2 On Wed, Dec 18, 2019 at 1:18 AM Hongtao Liu wrote: > > On Wed, Dec 18, 2019 at 4:26 PM Segher Boessenkool > wrote: > > > > On Wed, Dec 18, 2019 at 10:37:11AM +0800, Hongtao Liu wrote: > > > Hi: > > > This patch is to simplify A * C + (-D) -> (A - D/C) * C when C is a > > > power of 2 and D mod C == 0. > > > bootstrap and make check is ok. > > > > Why would this be a good idea? It is not reducing the number of > > operators or similar? > > > It helps VN, so that fre will delete redundant load. It is basically doing a factoring and undoing an optimization that was done in the front-end (see pointer_int_sum in c-common.c). But I think the optimization in the front-end should be removed. It dates from 1992, a time when GCC did not anything on the tree level and there was no GCSE (PRE) and the CSE was limited. Thanks, Andrew Pinski > > > > Segher > > > > -- > BR, > Hongtao