This patch adjusts what location is picked for a known variable value -- preferring to leave locations on the stack, even when a value is re-loaded into a register. The benefit is reduced location list entropy, on a clang-3.4 build I found that .debug_loclists reduces in size by 6%, from 29Mb down to 27Mb. The kind of change is demonstrated in the modifications to the spill-nospill.ll test below.
There's a slight risk from the fact that we don't terminate stack variable location at the end of the function, when the stack pointer gets modified a lot during frame destruction. The policy we follow right now [0] is that we expect consumers to know stack locations aren't valid outside the function body. Doing this more often increases the damage if a consumer doesn't have the same expectations. CC @dblaikie , who had an opinion on this last time it came up.
Testing: a few tests need the stack slot to be written to explicitly, to force LiveDebugValues into restoring the variable location to a register. I've added an explicit test for the desired behaviour in livedebugvalues_recover_clobbers.mir .