[PATCH] D105279: [RemoveRedundantDebugValues] Introduce a MIR pass that removes redundant DBG_VALUEs

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 9 01:11:11 PDT 2021


StephenTozer added a comment.

In D105279#2865319 <https://reviews.llvm.org/D105279#2865319>, @aprantl wrote:

> You probably also considered adding this functionality to MIBuilder or LiveDebugVariables itself, to avoid inserting duplicates in the first place. Would that be possible, or is there no good place in the existing code where we could add this to?

There was a previous patch up to this effect (D105025 <https://reviews.llvm.org/D105025>) that was abandoned due to performance concerns; scanning (potentially) the full basic block at insertion for every `DBG_VALUE` would be a quadratic solution, while this pass is linear. It would be possible to produce an optimized version using caching in LiveDebugVariables/LiveDebugValues (although probably not `MIBuilder`), but since they would all be linear time anyway I'm happier with the solution that has less complexity and doesn't insert more into two passes that are already quite dense.


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

https://reviews.llvm.org/D105279



More information about the llvm-commits mailing list