Allow and track variable assignments that happen in blocks that are out-of-scope. This happens when a DBG_INSTR_REF or DBG_VALUE gets moved to a block where no instructions are in its lexical scope, or the instructions in-scope are moved / merged so that the block is no longer in scope.
What to do in the general case is arguable -- LiveDebugValues already loses some variable locations due to its scope trimming, see PR48091 -- but the scope trimming is necessary for performance reasons. There's already a test though, llvm/test/DebugInfo/X86/stack-value-dwarf2.ll , that depends on assignments in out-of-scope blocks being preserved, so lets preserved VarLoc LiveDebugValues' behaviour for now. I ran it through the compile-time-tracker [0] and its performance effects are fractional.