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/
On 7/10/07, Chris Lattner <sabre at nondot.org> wrote:> 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.I don't need to approximate it, but I'd like to be able to track it, in the sense of being able to measure the heap allocations as they are being performed. For instance, is it possible to entirely replace the malloc/free called by the LLVM libraries with my own implementation? This would achieve my goals, as I'm not against heap allocations, I just need to be able to measure them. Sandro
On Tue, 10 Jul 2007, Sandro Magi wrote:> On 7/10/07, Chris Lattner <sabre at nondot.org> wrote: >> 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. > > I don't need to approximate it, but I'd like to be able to track it, > in the sense of being able to measure the heap allocations as they are > being performed. > > For instance, is it possible to entirely replace the malloc/free > called by the LLVM libraries with my own implementation? This would > achieve my goals, as I'm not against heap allocations, I just need to > be able to measure them.Not really. The JIT allocates from the same heap as the program being used. Your choices are to either override malloc/free for both the JIT and the program or for neither of them. -Chris -- http://nondot.org/sabre/ http://llvm.org/