From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126008 invoked by alias); 6 Mar 2018 16:52:59 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 125999 invoked by uid 89); 6 Mar 2018 16:52:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:zUUEBKk, H*i:CAHFci29DCP, H*f:CAHFci29DCP, H*i:sk:zUUEBKk X-HELO: mail-it0-f50.google.com Received: from mail-it0-f50.google.com (HELO mail-it0-f50.google.com) (209.85.214.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Mar 2018 16:52:56 +0000 Received: by mail-it0-f50.google.com with SMTP id n7so14528066ita.5 for ; Tue, 06 Mar 2018 08:52:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ixU7i2lLAftB2SRuAcndZl/Qo75NsYpUUCu99ztwRzo=; b=dAens8j2TsAvXPSlOBw9CJ9Zr1wRY7ax7OUpLpbOnZsBdWFmeLUsCUWz5OtEEwhOKW wHK9AXxA3fLYjKnJRFxtH4WbMmlgI87OZW6+8wlRCWKLVpny+SQ8rrk3T+nm7Wfr1S0U jYbYnQUsln1rmvutyvTkhMRb95QK1J0h2NqgO+lzQbvDVNLgb8jHMhpFN1jQbquj3rfd q+6cK3Q2D3XBZgLdbWBwFgOzXMuC7sEolsujQD+eV90+zgryIvrEXZsID2zdxEiCAHYv 4R7h0c4CY/nAPuPCdueXRQ3NXDf/8JFY+L8NH99ft+XwLatrhap6Ifa7F1TchtNh4FDF 1R/A== X-Gm-Message-State: AElRT7FeY25YVTJDqAQxAWoyxIC6ukNo3szbNKTQXYgJe8X4kdaSViN7 aeVNZA5LuVUh+9bjo1u+tz0dJNjsWLkLuyuf1H4= X-Google-Smtp-Source: AG47ELvaCb2Uz+Btga6s0L9o93ISaolmuN93XrYEtlRVCYDT5FJX0/cAsSYi4jlI5susHc0v0t/vibc1eK0cpKyNoHI= X-Received: by 10.36.92.136 with SMTP id q130mr19068059itb.112.1520355174914; Tue, 06 Mar 2018 08:52:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.105.200 with HTTP; Tue, 6 Mar 2018 08:52:54 -0800 (PST) In-Reply-To: References: From: "Bin.Cheng" Date: Tue, 06 Mar 2018 16:52:00 -0000 Message-ID: Subject: Re: eliminate dead stores across functions To: Martin Jambor Cc: Richard Biener , Prathamesh Kulkarni , GCC Development Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00078.txt.bz2 On Tue, Mar 6, 2018 at 4:50 PM, Bin.Cheng wrote: > On Tue, Mar 6, 2018 at 4:44 PM, Martin Jambor wrote: >> Hi Bin, >> >> On Tue, Mar 06 2018, Bin Cheng wrote: >>> On Tue, Mar 6, 2018 at 2:28 PM, Richard Biener >>>> >>>> Do you think the situation happens often enough to make this worthwhile? >>> There is one probably more useful case. Program may use global flags >>> controlling >>> how it does (heavy) computation. Such flags are only set couple of >>> times in execution >>> time. It would be useful if we can (IPA) propagate flags into computation heavy >>> functions by versioning (if necessary). For example: >>> >>> int flag = 1; >>> void foo () >>> { >>> //heavy computation wrto to flag >>> } >>> void main() >>> { >>> flag = 2; >>> foo(); >>> flag = 1; >>> foo(); >>> } >>> >> >> So basically IPA-CP done on (not-addressable) static global variables. >> Do you happen to know some real code which would benefit? I'd like to >> experiment with it but would like to have a real thing to look at, as >> opposed to artificial test cases. > As Richi pointed out, I think this is not rare in spec. For this > moment I only vaguely remember 544.nab_r for such issue, but I am sure > there are other cases. Sorry I forgot to mention it might not be static variables in file scope, that's why I mentioned LTO previously. Thanks, bin > > Thanks, > bin >> >> Thanks, >> >> Martin >> >>