r246991 - When building the alloca for a local variable, set its name

John McCall via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 8 10:26:39 PDT 2015


> On Sep 8, 2015, at 8:25 AM, David Blaikie <dblaikie at gmail.com> wrote:
> On Tue, Sep 8, 2015 at 2:18 AM, John McCall via cfe-commits <cfe-commits at lists.llvm.org <mailto:cfe-commits at lists.llvm.org>> wrote:
> Author: rjmccall
> Date: Tue Sep  8 04:18:30 2015
> New Revision: 246991
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=246991&view=rev <http://llvm.org/viewvc/llvm-project?rev=246991&view=rev>
> Log:
> When building the alloca for a local variable, set its name
> separately from building the instruction so that it's
> preserved even in -Asserts builds.
> 
> Why do we want to preserve this name in particular in -Asserts builds?

It’s a fairly small runtime cost — no twine appending, only present on a tiny fraction of instructions, unlikely to collide within a single function — that makes reading the IR dramatically easier.  That’s still useful to be able to do with a production compiler, both for us and for sophisticated users.

IIRC, Daniel did the perf work on IR names way back when; he might have other thoughts.

John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150908/d7f68395/attachment-0001.html>


More information about the cfe-commits mailing list