[LLVMdev] Custom allocators for MachineBasicBlocks and STL containers

Evan Cheng evan.cheng at apple.com
Fri Feb 14 15:34:43 PST 2014


On Feb 14, 2014, at 1:52 PM, Eli Bendersky <eliben at google.com> wrote:

> Hello,
> 
> I was looking at how the memory for MachineBasicBlocks is managed and something seems strange.
> 
> On one hand, a MachineFunction uses a recycling allocator to create and destroy MBBs without costly heap allocation (the same is done for MachineInstrs, MachineOperands, etc.).
> 
> On the other hand, each MBB also has a number of STL vectors within it. For example, for Predecessors, Successors, Weights, LiveIns. Maintaining these vectors involves heap allocation and they don't have custom allocators, AFAICS.  
> 
> Is there some magic I'm missing here, or does this make little sense?

Jakob would know for sure. My guess is it takes time to move all the data structure over to the custom allocators so we just tackled the ones that provide the most bang for the buck.

Evan

> 
> Eli
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list