On Wed, 20 Jun 2007, Sandro Magi wrote:> To this end, are there any implicit allocations being done by > generated LLVM code, other than the system stack?heap allocations? Only malloc/free. Note that the compiler does generate calls to runtime libraries (e.g. libstdc++ and libgcc), we don't have control over when they do allocations. The libstdc++ calls show up in the .ll file, but the libgcc ones don't. I don't think any libgcc routines do heap allocations. -Chris> On 6/18/07, Sandro Magi <naasking at gmail.com> wrote: >> Given my recent posts, I think it's obvious that I'm trying to figure >> out how to build a resource-aware VM for a high-level language. >> >> I've figured out adequate solutions for most of the problems I've >> encountered, including separate heaps, quotas, etc. However, I'm not >> sure how I can account for a thread's stack space. Given a language >> process (LP) running in a heap with a quota, a thread in that LP can >> exceed the LP's quota simply by recursing infinitely since stack space >> allocation is outside of my VM's control. >> >> So how can I account for the stack space consumed by the thread >> running in that LP, or control the allocation of stack space? One >> solution is to CPS-transform the program, so that all activation >> frames are explicitly allocated from the LP's heap. Is there another >> way? >> >> Sandro >> > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-Chris -- http://nondot.org/sabre/ http://llvm.org/
On 6/20/07, Chris Lattner <sabre at nondot.org> wrote:> On Wed, 20 Jun 2007, Sandro Magi wrote: > > To this end, are there any implicit allocations being done by > > generated LLVM code, other than the system stack? > > heap allocations? Only malloc/free. Note that the compiler does generate > calls to runtime libraries (e.g. libstdc++ and libgcc), we don't have > control over when they do allocations. The libstdc++ calls show up in the > .ll file, but the libgcc ones don't. I don't think any libgcc routines do > heap allocations.Are these calls distinguishable in the .ll file somehow? Do these calls map to intrinsics and certain instructions? Sandro
How about if I were to use LLVM's JIT? I suspect plenty of allocations are performed in the JIT. Sandro On 6/20/07, Chris Lattner <sabre at nondot.org> wrote:> On Wed, 20 Jun 2007, Sandro Magi wrote: > > To this end, are there any implicit allocations being done by > > generated LLVM code, other than the system stack? > > heap allocations? Only malloc/free. Note that the compiler does generate > calls to runtime libraries (e.g. libstdc++ and libgcc), we don't have > control over when they do allocations. The libstdc++ calls show up in the > .ll file, but the libgcc ones don't. I don't think any libgcc routines do > heap allocations. > > -Chris >
On Sun, 8 Jul 2007, Sandro Magi wrote:> How about if I were to use LLVM's JIT? I suspect plenty of allocations > are performed in the JIT.The JIT does a ton of heap allocation. There is no way to approximate it from the code you give it. -Chris> Sandro > > On 6/20/07, Chris Lattner <sabre at nondot.org> wrote: >> On Wed, 20 Jun 2007, Sandro Magi wrote: >>> To this end, are there any implicit allocations being done by >>> generated LLVM code, other than the system stack? >> >> heap allocations? Only malloc/free. Note that the compiler does generate >> calls to runtime libraries (e.g. libstdc++ and libgcc), we don't have >> control over when they do allocations. The libstdc++ calls show up in the >> .ll file, but the libgcc ones don't. I don't think any libgcc routines do >> heap allocations. >> >> -Chris >> > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-Chris -- http://nondot.org/sabre/ http://llvm.org/