<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Eli,<div><br></div><div>What is the specific problem here?  Is the cost to compute this too high, or is the symbol requested for the same MBB multiple times?  If it is the latter, it should be enough to add a simple "MCSymbol*" cache to MBB.  This would be cleaner than adding a scratch buffer to MachineFunction.</div><div><br></div><div>-Chris<br><div><br></div><div><br><div><div>On Apr 22, 2013, at 9:14 AM, Eli Bendersky <<a href="mailto:eliben@google.com">eliben@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div dir="ltr">Ping!</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 18, 2013 at 3:27 PM, Eli Bendersky<span class="Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:eliben@google.com" target="_blank">eliben@google.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr">MachineBasicBlock::getSymbol gets called quite a lot and was doing a lot of repetitive work. Most of the symbol remains unchanged between MBBs in the same function, and yet getSymbol was laboriously reconstructing the full symbol with a concatenation of Twines. This patch optimizes this away: MachineFunction caches the symbol "template" for its MBBs and does a minimal amount of work to generate a new symbol without too much copying.<div><br></div><div>There's no change in functionality, but this makes MachineBasicBlock::getSymbol somewhere between 25-50% faster (exact numbers are hard to obtain for this very internal method).</div><div><br></div><div>Please take a look,</div><div>Eli</div><div><br></div></div></blockquote></div><br></div>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</div></blockquote></div><br></div></div></body></html>