This is a patch to share / work-in-progress rather than something that's ready for review right now.
In PR40188 [0] there's some discussion of shuffling dbg.values to make function argument dbg.values more reliable, by adding more information in SROA. That might require more fine grained salvaging of debugging information. I've had this patch hanging around for a bit (it's used by something I've yet to upload), and it might be useful for PR40188; or it might not, no worries.