[PATCH] optimize MachineBasicBlock::getSymbol a bit

Chris Lattner clattner at apple.com
Mon Apr 22 14:09:53 PDT 2013


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!

-Chris




More information about the llvm-commits mailing list