This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Speedup alias analysis [patch]
- From: Chris Lattner <sabre at nondot dot org>
- To: Andrew MacLeod <amacleod at redhat dot com>
- Cc: Diego Novillo <dnovillo at redhat dot com>,gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 24 Jun 2003 22:48:51 -0500 (CDT)
- Subject: Re: [tree-ssa] Speedup alias analysis [patch]
On 24 Jun 2003, Andrew MacLeod wrote:
> If I recall, dont you simply treat all locals and such as pointers? so
> int a; is treated like 'int *a = alloca(sizeof(int))' so you never have
> to take its address, it gets its 'default' memory location on the
> stack. Then if you take the address of 'a', and assign it to a
> pointer, you really just copy your pointer to 'a', since thats all you
> have anyway. If you have a = 10; you see it as *a = 10;
>
> Do I remember that correctly? :-)
Yup, that's exactly right. This directly exposes the semantics used by C
programs. After that, it is up to the optimizers to do the optimization
of promoting these memory locations to registers, where possible.
Another big advantage of this is that this makes the Tree->LLVM expanders
MUCH more simple: lvalues are simply values that have their address
available, rvalues do not.
-Chris
--
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/