[LLVMdev] Dataflow analysis based optimisations

David Given dg at cowlark.com
Fri Aug 27 17:16:32 PDT 2010


I'm working on an LLVM-based compiler for a very closure-centric
language. It's becoming apparent that it's going to suffer heavily from
garbage collector churn, as all the useful programming idioms the
language makes possible are going to involve memory allocations, either
to create objects or to allocate storage for upvalues.

However, it's possible to optimise away a lot of heap allocations, and
replace them with allocas instead, *if* we know that the lifetime of the
object is going to be shorter than the lifetime of the stack frame ---
in other words, the object will be used strictly inside the function and
nowhere else. This applies to both upvalues and objects.

Does LLVM have any mechanism for doing the kind of dataflow analysis
required to track object lifetime like this?

-- 
┌─── 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/8bd77191/attachment.sig>


More information about the llvm-dev mailing list