<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 style>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 style><br>
</div><div style>Please take a look,</div><div style>Eli</div><div style><br></div></div>