[LLVMdev] Dataflow analysis based optimisations
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?
┌─── ｄｇ＠ｃｏｗｌａｒｋ．ｃｏｍ ───── 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