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] 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/




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