This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: eliminate dead stores across functions
- From: "Bin.Cheng" <amker dot cheng at gmail dot com>
- To: Martin Jambor <mjambor at suse dot cz>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Tue, 6 Mar 2018 16:52:54 +0000
- Subject: Re: eliminate dead stores across functions
- Authentication-results: sourceware.org; auth=none
- References: <CAAgBjMkcuch04W94DB06Vv7oYZQPLk2VRN5ALd_0Vt=CmzZ=-w@mail.gmail.com> <CAFiYyc0ZwKqyfX2hyFS+s7tB=gaEJ5OS1zq6BciDFLnn=ynM3w@mail.gmail.com> <CAHFci2_vzxxtSjzSba7z-HZQJx29zJCWHBTTaQABeEytCa0yCw@mail.gmail.com> <ri64lltf922.fsf@suse.cz> <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
>>
>>