[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
Mon Jul 12 09:55:34 PDT 2021


StephenTozer added a comment.

I'm not sure whether the most recent change is necessary; on the one hand, I understand that this change is meant to NFC, so affecting the actual debug output feels like a mistake, and I can see this change as being justified solely for the sake of keeping this patch NFC. On the other hand, the fact that removing redundant debug values results in a change in the DWARF is more a fault of the DWARF emission step than this pass I think. If we don't need to use a constant `DW_AT_location` instead of a `DW_AT_const_value`, then a debug value that is never live shouldn't cause us to emit the former rather than the latter, and if there is a reason to pick one over the other then the distinguishing factor should be something more explicit than the presence of an otherwise unused debug instruction. But this patch shouldn't need to be held up by that concern, since it works fine as is.

LGTM, but preferably leave it open for a day to see if anyone else has thoughts about this change.


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

https://reviews.llvm.org/D105279



More information about the llvm-commits mailing list