This is an archive of the discontinued LLVM Phabricator instance.

WIP: [LiveDebugValues] Support the debug entry values for modified parameters
AbandonedPublic

Authored by djtodoro on Oct 15 2019, 12:40 AM.

Details

Summary

Keep track of an entry value of a modified parameter if the modification of the parameter can be expressed in terms of its entry value and a constant (expression like (DW_OP_LLVM_entry_value reg1; DW_OP_plus_uconst, 7, DW_OP_stack_value) where we describe situation like param = param + 7;).

Diff Detail

Event Timeline

djtodoro created this revision.Oct 15 2019, 12:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 15 2019, 12:40 AM
aprantl added inline comments.Oct 15 2019, 1:21 PM
llvm/include/llvm/IR/DebugInfoMetadata.h
2471

This doesn't seem to be a good API. I think this is supposed to recognize some specific high-level pattern, but doesn't really say so? Given how easily salvageDebugInfo keeps appending operations to DIExpressions, it seems very unlikely that this condition would be hit very often.

What's the use-case for this, and is there a better way to achieve the same result?

aprantl added inline comments.Oct 15 2019, 1:23 PM
llvm/include/llvm/IR/DebugInfoMetadata.h
2471

I.e., were are these expressions produced that we can be sure that we will recognize them with this function?

djtodoro marked an inline comment as done.Oct 16 2019, 5:18 AM
djtodoro added inline comments.
llvm/include/llvm/IR/DebugInfoMetadata.h
2471

Thanks for the comments! We are on the same page with this, that is why I left it as a 'WIP'. :)

From very high level, we want to recognize (simple) modifications of a parameter that could be expressed in terms of its entry value. By looking at the test provided, the problem is we have only the DBG_VALUE describing the modification (made from the Salvage Debug Info since the add instruction was deleted during the Combine redundant instructions pass). I am not sure if we should be aware what was the actual modification, we could just see if the DBG_VALUE register location is the same as the entry value and apply the DIExpression ops on to the entry value expression. I will examine that in details and be back with more info.

djtodoro updated this revision to Diff 225201.Oct 16 2019, 5:23 AM
djtodoro added a reviewer: dstenb.

-Rebase

djtodoro abandoned this revision.Nov 4 2019, 1:57 AM

I will revisit this, since we need some more general approach.
(abandoning for now)