[llvm-commits] SelectionDAG Loosing debug information

Villmow, Micah Micah.Villmow at amd.com
Mon May 9 16:38:54 PDT 2011


> -----Original Message-----
> From: Devang Patel [mailto:dpatel at apple.com]
> Sent: Monday, May 09, 2011 4:28 PM
> To: Villmow, Micah
> Cc: llvm-commits
> Subject: Re: [llvm-commits] SelectionDAG Loosing debug information
> 
> DanglingDebugInfoMap maps llvm::Value to a node. So, the mapping is
> invalid whenever NodeMap is cleared. Are you sure this patch is the
> right approach here ? 
[Villmow, Micah] Maybe, I'm not 100% familiar with the code, but it 
seems to fix the problem we are having. The problem we are having is this:
The bitcode attached to the bug has a case where after running inlineAll
 and then mem2reg, the resulting debug information is attached to a 
phi node. The debug information references an instruction in a previous
basic block but has no references in the current basic block. By my
understanding after looking at the code, no nodes are created for the
phi node and the debug information is added to the map. However, since
no nodes in the current block reference the debug information, there
can be no resolving of the dangling reference by the end of the
block, which the map then gets cleared.

What this change does is allows for all of the dangling references to
be resolved by the current or previous block at some point in the future
and after all the basic blocks have been processed and there is no
possibility of resolving the dangling reference anymore, then it is cleared.

I don't see this as being a problem when NodeMap is cleared simply because
if the node existed in the current basic block, then the dangling reference
wouldn't exist in the DanglingDebugInfoMap as it is replaced once it is resolved.

Micah
> -
> Devang
> 
> On May 9, 2011, at 4:04 PM, Villmow, Micah wrote:
> 
> > Patch attached.
> >
> >> -----Original Message-----
> >> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-
> >> bounces at cs.uiuc.edu] On Behalf Of Eric Christopher
> >> Sent: Monday, May 09, 2011 12:50 PM
> >> To: Villmow, Micah
> >> Cc: llvm-commits
> >> Subject: Re: [llvm-commits] SelectionDAG Loosing debug information
> >>
> >>
> >> On May 9, 2011, at 11:57 AM, Villmow, Micah wrote:
> >>
> >>> I've attached a patch to bug9879 that stops SelectionDAG from
> >> dropping debug information. Can someone review to see if this
> approach
> >> is correct or if a better one is preferred?
> >>>
> >> No patch attached.
> >>
> >> -eric
> >> _______________________________________________
> >> llvm-commits mailing list
> >> llvm-commits at cs.uiuc.edu
> >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >
> > <bug9869.patch>_______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 






More information about the llvm-commits mailing list