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
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? |
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? |
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. |
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?