[PATCH] D43324: WIP: [Utils] Salvage debug info of DCE'ed extractvalue instructions

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 11:37:36 PST 2018


vsk added a comment.

In https://reviews.llvm.org/D43324#1011509, @aprantl wrote:

> > I have not yet found a small, end-to-end test for this patch
>
> I don't think that one is strictly necessary. Testing the result of the pass directly is preferable anyway.


I wasn't planning on checking in the end-to-end test -- I just wanted to make sure that it's possible to see variables salvaged from extractvalue instructions in the debugger.

I did some more digging and found that FastISel does not emit DBG_VALUE MI's when it sees the sorts of llvm.dbg.value() instructions this patch generates. Concretely, no DBG_VALUE is generated for this instruction:

  %s_ev = load %struct.S, %struct.S* %s
  %x_ev = extractvalue %struct.S %s_ev, 0
  call void @llvm.dbg.value(metadata %struct.S %s_ev, metadata !24, metadata !DIExpression()), !dbg !55


https://reviews.llvm.org/D43324





More information about the llvm-commits mailing list