[LLVMdev] Custom allocators for MachineBasicBlocks and STL containers

Eli Bendersky eliben at google.com
Fri Feb 14 15:45:45 PST 2014


On Fri, Feb 14, 2014 at 3:40 PM, Jakob Stoklund Olesen <jolesen at apple.com>wrote:

>
> On Feb 14, 2014, at 3:34 PM, Evan Cheng <evan.cheng at apple.com> wrote:
>
> >
> > 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.
>
> What Evan said.
>
> The MachineInstr class is completely heap independent. It would be nice to
> do the same for MBB, but the gains are small.
>

Thanks. This makes sense - I just wanted to make sure I'm not missing
anything.

Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140214/cc031836/attachment.html>


More information about the llvm-dev mailing list