This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] Improve gimplification/dominator optimizations


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]