[LLVMdev] Dataflow analysis based optimisations
dg at cowlark.com
Sat Aug 28 08:53:06 PDT 2010
On 28/08/10 02:20, Kenneth Uildriks wrote:
> There are passes which mark function parameters as "nocapture", which
> means that the function does not store the passed-in pointer for use
> after that function returns. If pointers to a newly created object
> are only ever passed through "nocapture" parameters, never stored in a
> global, and not returned from the function, then that object is dead
> when the function that created the object returns.
That sounds ideal; thanks!
I assume that I would need to implement my own memory-allocation
instruction and then produce a custom pass, running after the
FunctionAttrsPass, which would then lower the instructions to either a
call to malloc or an alloca instruction. I see vague references to an
LLVM malloc instruction; did this disappear after 2.6?
┌─── ｄｇ＠ｃｏｗｌａｒｋ．ｃｏｍ ───── http://www.cowlark.com ─────
│ "Home is where, when you have to go there, they have to take you in."
│ --- Cordelia Naismith
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 254 bytes
Desc: OpenPGP digital signature
More information about the llvm-dev