[PATCH] LowerDbgDeclare - get rid of redundant dbg.values when an alloca survives optimization

Adrian Prantl aprantl at apple.com
Mon Mar 31 10:16:09 PDT 2014


On Mar 31, 2014, at 9:25 AM, Robinson, Paul <Paul_Robinson at playstation.sony.com> wrote:

>> -----Original Message-----
>> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-
>> bounces at cs.uiuc.edu] On Behalf Of Adrian Prantl
>> Sent: Monday, March 31, 2014 8:58 AM
>> To: David Blaikie
>> Cc: llvm-commits
>> Subject: Re: [PATCH] LowerDbgDeclare - get rid of redundant dbg.values
>> when an alloca survives optimization
>> 
>> 
>> On Mar 30, 2014, at 12:02 PM, David Blaikie <dblaikie at gmail.com> wrote:
>> 
>>> When you say "dropping all dbg.declares" - do you mean we're removing
>>> that intrinsic from LLVM entirely (ie: it won't exist) or that we
>>> "drop" dbg.declares in IR by removing them at some point in the middle
>>> end?
>> 
>> I'm not sure if I understand this question entirely, but yes,
>> LowerDbgDeclare will lower a dbg.declare into multiple dbg.values (one
>> for each use) and then delete the dbg.declare.
> 
> In terms of information content, it seems like we could eliminate the
> dbg.declare intrinsic entirely by having the frontend attach one more bit
> of metadata to the associated alloca, which already has two of the three
> bits of info that dbg.declare has.

In the long term, moving towards metadata would certainly be preferable! The fact that dbg.* intrinsics don’t show up as regular uses also makes dealing with them a pain and  finding them unnecessarily slow.

> Given the number of -g optimization issues we've found (without really 
> trying) it might be worth thinking about how to eliminate dbg.value also.
> --paulr
> 

-- adrian





More information about the llvm-commits mailing list