[tree-ssa] Speedup alias analysis [patch]

Chris Lattner sabre@nondot.org
Wed Jun 25 05:00:00 GMT 2003


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/





More information about the Gcc-patches mailing list