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

Adrian Prantl aprantl at apple.com
Fri Oct 18 11:22:23 PDT 2013


On Oct 18, 2013, at 10:35, Adrian Prantl <aprantl at apple.com> wrote:

> 
> On Oct 18, 2013, at 10:24, David Blaikie <dblaikie at gmail.com> wrote:
> 
>> 
>> 
>> 
>> On Fri, Oct 18, 2013 at 10:12 AM, Adrian Prantl <aprantl at apple.com> wrote:
>> Any final verdict for this change?
>> 
>> I'm not really familiar with this stuff to provide a 'final verdict' as it were, but I'll ask some questions anyway...
>> 
>> Is this the correct test? Is it possible that the variable might be reconstituted around the call, rather than kept live for the entire range?
>> If there are things that prevent the alloca from being elided, are those things enshrined in a test somewhere that we could reuse, rather than reimplementing one part of them?
> 
> That’s a very good point indeed: I just discovered 
>> bool llvm::isAllocaPromotable(const AllocaInst *AI)
> in mem2reg.

Yes that seems to work fine and is a lot cleaner.

> 
>> 
>> (& if you felt like it, you could probably use find_if to write that loop - but that might not add a lot to the situation (& not sure it'll work with all the template machinery of 'isa'))
>> 

I will save this change for an independent patch.

Thanks!

-- adrian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Debug-info-Reduce-the-amount-of-redundant-debug-info.patch
Type: application/octet-stream
Size: 6630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131018/c6043078/attachment.obj>


More information about the llvm-commits mailing list