See PR41475 for a short description of the problem.
salvageDebugInfo() in Transforms/Utils/Local.cpp decides how an instruction's actions are affecting a value that is used in a dbg.value() call and attempts to return a DIExpr that would make it possible to reconstruct the original value from the instruction's source operand in case the instruction is removed by someone (e.g. by instcombine). Noop casts don't change the value and we can safely say that the cast's source operand can be used by the debug user, thus we simply return the DIExpr found there.
This patch extends this to zext instructions, which are not a noop cast, but arguably don't change the value. Thus the source value of a zext can replace the result value in debug users and survive a removal of the zext instruction.