Jeremy Morse noted in https://reviews.llvm.org/D154451 that LLVM doesn't drop a dbg.value when its value is being removed, but rather sets the operand to undef. This preserves the debug info and gives allows the debugger to instead inform the user that the variable has been optimized out, rather than not displaying the variable at all.
This patch fixes that mistake done in the previous revision by mirroring that behaviour in MLIR as well.