[2/2][RemoveRedundantDebugValues] Add a Pass that removes redundant DBG_VALUEs
authorDjordje Todorovic <djordje.todorovic@syrmia.com>
Thu, 15 Jul 2021 06:45:19 +0000 (23:45 -0700)
committerDjordje Todorovic <djtodoro@cisco.com>
Thu, 15 Jul 2021 07:08:31 +0000 (00:08 -0700)
commitfa2daaeff82e3eb26fe7008715024f5bc11f7f1a
treebbc264419ba844188570a154e543d504617e9d5b
parent53fed88159d00a340797cb4966dce471bc9fba21
[2/2][RemoveRedundantDebugValues] Add a Pass that removes redundant DBG_VALUEs

This patch adds the forward scan for finding redundant DBG_VALUEs.

This analysis aims to remove redundant DBG_VALUEs by going forward
in the basic block by considering the first DBG_VALUE as a valid
until its first (location) operand is not clobbered/modified.
For example:

(1) DBG_VALUE $edi, !"var1", ...
(2) <block of code that does affect $edi>
(3) DBG_VALUE $edi, !"var1", ...
 ...
in this case, we can remove (3).

Differential Revision: https://reviews.llvm.org/D105280
llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp
llvm/test/CodeGen/PowerPC/non-debug-mi-search-frspxsrsp.ll
llvm/test/DebugInfo/MIR/X86/remove-redundant-dbg-vals.mir