[LLVMdev] Dataflow analysis based optimisations

David Given 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?

-- 
┌─── dg@cowlark.com ───── 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...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100828/109e611e/attachment.sig>


More information about the llvm-dev mailing list