This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: eliminate dead stores across functions
- From: Martin Jambor <mjambor at suse dot cz>
- To: "Bin.Cheng" <amker dot cheng at gmail dot com>, Richard Biener <richard dot guenther at gmail dot com>
- Cc: Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>, GCC Development <gcc at gcc dot gnu dot org>
- Cc:
- Date: Tue, 06 Mar 2018 17:44:21 +0100
- 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>
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.
Thanks,
Martin