Bit-Tracking Dead Code Elimination (bdce) do not mark dbg.value as undef after deleting instruction.
which shows invalid state of variable in debugger.
This patches fixes this by marking the dbg.value as undef which depends on dead instruction.
This fixes
https://bugs.llvm.org/show_bug.cgi?id=41925
As the reproducer in PR41925 is small, could you include the source code here? (I'm assuming the IR comes from that). It'll make it easier for someone reading this test to understand what it's doing.