[PATCH] optimize MachineBasicBlock::getSymbol a bit

Eli Bendersky eliben at google.com
Mon Apr 22 14:12:25 PDT 2013


On Mon, Apr 22, 2013 at 2:09 PM, Chris Lattner <clattner at apple.com> wrote:

> On Apr 22, 2013, at 1:23 PM, Eli Bendersky <eliben at google.com> wrote:
> >
> > I did a bit more measuring, implementing also rudimentary caching of the
> MCSymbol as you suggested. The results suggest that a large part of the
> cost comes from symbol requests in the same MBB multiple times, and both
> solutions mitigate that (my original patch simply by virtue of making the
> computation much cheaper). The numbers are:
> >
> > baseline runtime of all getSymbol calls combined (no patches): B
> > with original (scratch buffer in MC) patch: ~0.75B
> > with caching MCSymbol patch: ~0.75B
> > with both patches: ~0.7B
> >
> > Given this, do you think it's worth it to apply both patches? If not
> then I agree that caching MCSymbol is the cleaner way to go.
>
> Lets just cache the symbol, I'd like to keep things simple.  Thanks!
>

Makes sense. I'll commit a patch with caching.

Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130422/042d946b/attachment.html>


More information about the llvm-commits mailing list