When DbgValueHistoryCalculator is determining which registers
that are clobbered within the function body it now got the
alternative to rely on FrameDestroy attributes when finding
out if an instruction is part of the epilogue or not.
In the past it treated all instructions with the same DebugLoc
as the return instruction as epilogue. So if for example the
whole function was written on a single line everything ended up
being treated as the epilogue.
For the above to work properly a target has to mark epilogue
instructions as FrameDestroy (I do not think all targets are
doing that, so therefore this isn't enabled by default).
Another difference between the old collectChangingRegs and
the new collectChangingRegsInBody is that the new method
examines individual instructions within bundles (to support
the case where a bundle contain a mix of prolog/epilog
instructions and function body instructions. That might be
an odd case, but there is nothing today that prohibits such
bundling.
Do you know which backends don't mark up epilog instructions with FrameDestroy? Is it feasible to fix the backends? Seems like collectChangingRegsInBody is just a more precise way of doing the job of collectChangingRegs: it'd be great to just have one copy of the logic.