[llvm-commits] [PATCH] Add an iplist::clearAndLeakNodesUnsafely() function, speed up Recyler:clear()

Jakob Stoklund Olesen jolesen at apple.com
Wed Jan 2 10:38:04 PST 2013


Hi,

I am trying to speed up the ~MachineFunction destructor. We are currently wasting a lot of time and memory bandwidth by pointlessly visiting and changing all the instructions in the function before the BumpPtrAllocator gives its pages back to the OS.

I am eventually going to make all MachineInstr memory be allocated from the same BumpPtrAllocator so the whole MachineFunction data structure can be taken down by flushing the allocator. This is similar to Apache's memory pools.

As a first step, I need to convince an iplist to let go of its contents without pulling every object into cache (and dirtying all the cache lines as a bonus!). The clearAndLeakNodesUnsafely() function added in the first patch does that.

Second, specialize Recycler::clear(BumpPtrAllocator) to avoid doing the same thing with the free list.

Please review!

/jakob


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-an-iplist-clearAndLeakNodesUnsafely-function.patch
Type: application/octet-stream
Size: 2702 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130102/8ede633e/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Special-case-Recycler-clear-BumpPtrAllocator.patch
Type: application/octet-stream
Size: 1641 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130102/8ede633e/attachment-0001.obj>


More information about the llvm-commits mailing list