This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: random thought - optimizer
- To: "Zack Weinberg" <zackw at stanford dot edu>
- Subject: Re: random thought - optimizer
- From: law at redhat dot com
- Date: Mon, 02 Jul 2001 07:34:12 -0700
- cc: gcc at gcc dot gnu dot org
- Reply-To: law at redhat dot com
In message <20010701194819.I18369@stanford.edu>you write:
> My question is, what sort of analysis would it take to recognize this
> condition? I'm aware that optimizing this function is somewhat silly,
> but I'd think that noticing when a static variable can have no effect
> on the output of a program, might be worthwhile in more places than this.
*If* you could prove that a particular MEM is local, then it would be
trivial for the SSA dead code elimination to do this. All it would have
to do is not mark the store as important during the initial scan for
important instructions.
Similarly, we would like to be able to detect stores into the local frame
distinctly from those in the outgoing argument space so that we can perform
this kind of optimization on local automatic memory.
The trick (of course) is proving the MEM is local and not aliased.
jeff
jeff