This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Improve gimplification/dominator optimizations
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: 11 Aug 2003 15:08:29 -0400
- Subject: Re: [tree-ssa] Improve gimplification/dominator optimizations
- References: <200308111716.h7BHGHj6024381@speedy.slc.redhat.com>
On Mon, 2003-08-11 at 13:16, law@redhat.com wrote:
>
> This patch fixes 20030708-1.c and 20030807-5.c.
>
> In simplest terms, if we have something like
>
> result = foo->code;
> [ ... ]
> result2 = foo->code;
>
> Where "foo" is in static memory, addressable, or for some other reason is
> not SSA renamed, then we will never detect the redundant load of ->code.
>
> To expose the redundant load we rewrite that into
>
> temp.1 = foo;
> result = temp.1->code;
> [ ... ]
> temp.2 = foo;
> result2 = temp.2->code;
>
>
> Which is more easily optimized into
>
> temp.1 = foo;
> result = temp.1->code
> [ ... ]
> result2 = result;
>
I dont suppose we do this for all component_refs and access to
addressable/static memory/non renamed things.. or do we?
I see lots of code which load globals or component_refs of globals
multiple times before any killing stores or function calls...
Andrew