From: "Bin.Cheng" <amker.cheng@gmail.com>
To: Martin Jambor <mjambor@suse.cz>
Cc: Richard Biener <richard.guenther@gmail.com>,
Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>,
GCC Development <gcc@gcc.gnu.org>
Subject: Re: eliminate dead stores across functions
Date: Tue, 06 Mar 2018 16:52:00 -0000 [thread overview]
Message-ID: <CAHFci2-peax+Jg8Nwtrg96eXyoc9xx0WeV66=QuaMWYv7V-SQQ@mail.gmail.com> (raw)
In-Reply-To: <CAHFci29DCP=zUUEBKk72O13XDw7H0D5CLY4hNREb6OgJvHCVhg@mail.gmail.com>
On Tue, Mar 6, 2018 at 4:50 PM, Bin.Cheng <amker.cheng@gmail.com> wrote:
> On Tue, Mar 6, 2018 at 4:44 PM, Martin Jambor <mjambor@suse.cz> 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
>>
>>
next prev parent reply other threads:[~2018-03-06 16:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-06 12:01 Prathamesh Kulkarni
2018-03-06 14:28 ` Richard Biener
2018-03-06 15:50 ` Bin.Cheng
2018-03-06 16:09 ` Richard Biener
2018-03-06 16:44 ` Martin Jambor
2018-03-06 16:50 ` Bin.Cheng
2018-03-06 16:52 ` Bin.Cheng [this message]
2018-03-06 16:49 ` William Cohen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHFci2-peax+Jg8Nwtrg96eXyoc9xx0WeV66=QuaMWYv7V-SQQ@mail.gmail.com' \
--to=amker.cheng@gmail.com \
--cc=gcc@gcc.gnu.org \
--cc=mjambor@suse.cz \
--cc=prathamesh.kulkarni@linaro.org \
--cc=richard.guenther@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).