[PATCH] ADCE: Remove debug info intrinsics in dead scopes

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 22:29:37 PDT 2016


Does it make sense to do this in ADCE and ADCE only? Lots of code can
remove instructions & could be the place where a scope ceases to exist, so
it seems strange to make this change only here, doesn't it?

I'm assuming you want to do this to reduce IR size early on? (pre-(Thin)LTO
merge?) Maybe as a separate pass?

If it's just to reduce debug info output - maybe better to just delay until
IR generation? (perhaps we already do this, I forget?)

On Tue, Mar 29, 2016 at 12:34 PM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:

> During ADCE, track which debug info scopes still have live references
> from the code, and delete debug info intrinsics for the dead ones.
>
> These intrinsics describe the locations of variables (in registers or
> stack slots).  If there's no code left corresponding to a variable's
> scope, then there's no way to reference the variable in the debugger and
> it doesn't matter what its value is.
>
> I add a DEBUG printout when the described location in an SSA register,
> in case it helps some trying to track down why locations get lost.
> However, we still delete these; the root problem is that the scope
> itself isn't attached to any real code.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160329/729a2d9c/attachment.html>


More information about the llvm-commits mailing list