[PATCH] D58042: [LiveDebugValues] Emit parameter's entry value

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 6 08:47:03 PDT 2019


dstenb added a comment.

In D58042#1484188 <https://reviews.llvm.org/D58042#1484188>, @dstenb wrote:

> I cherry-picked the patches on top of r359425, and tried out some examples. Doing that, I encountered a case where entry values are not inserted with this patch.


I had a look at this. `LiveDebugValues::ExtendRanges()` stops adding debug value instructions to `ParamEntryVals` as soon as it encounters a debug value for a variable that has already been seen, as pointed out by the //"Insert DEBUG_VALUE instructions that track parameters into ParamEntryVals."// block comment.

In this test case we are left with redundant DEBUG_VALUE instructions for `p` after LiveDebugVariables:

  # *** IR Dump After Virtual Register Rewriter ***:                                                                                               
  # Machine code for function foo: NoPHIs, TracksLiveness, NoVRegs, NoGlobalPredicates                                                             
  Function Live Ins: $edi                                                                                                                          
                                                                                                                                                   
  0B  bb.0.entry:                                                                                                                                  
        liveins: $edi                                                                                                                              
        DBG_VALUE $edi, $noreg, !"p", !DIExpression(), debug-location !18; kommentar.c:2:13 line no:2                                              
        DBG_VALUE $edi, $noreg, !"p", !DIExpression(), debug-location !18; kommentar.c:2:13 line no:2
        DBG_VALUE $esi, $noreg, !"q", !DIExpression(), debug-location !19; kommentar.c:2:20 line no:2                                              
        DBG_VALUE $edx, $noreg, !"r", !DIExpression(), debug-location !20; kommentar.c:2:27 line no:2                                                                                       

so that seems to be why entry values are not emitted for `q` and `r`, unless I have misunderstood something.

I don't know what it would take to stop LiveDebugVariables from emitting the redundant debug values in the first place. If it is not trivial, or there might perhaps be other cases where we can land in redundant entries, then perhaps this patch should be able to handle those entries?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58042/new/

https://reviews.llvm.org/D58042





More information about the llvm-commits mailing list