Fixes https://github.com/llvm/llvm-project/issues/62725
When running llc on the IR file in the above issue, after ISel there is a DBG_INSTR_REF and a single DBG_PHI that it references; at some point in the MIR pipeline, the block containing the DBG_PHI becomes unreachable. When we reach LiveDebugValues, this results in a crash due to unreachable blocks not being considered: In the initial tracking of DBG_PHIs, we will set the value of the lone DBG_PHI as the live-in value at the phi location, i.e. {4,0,4}. In ExtendRanges we perform a machine value dataflow analysis and apply the result to the collected DBG_PHIs. *Generally* this means each DBG_PHI will be updated to use the resolved value if one is found, and otherwise is unchanged. When the DBG_PHI is in an unreachable block however it will be updated to use the empty value instead, which is inconsistent with other phi values (which use an empty optional instead), resulting in us attempting to use the empty value as an actual value and triggering an assertion.
This patch fixes this error by checking for empty live-in values after the data flow analysis, and continuing to use the existing phi value if no value was found for that phi in the analysis. This prevents crashes from mishandling the empty value internally, and results in the correct value being found for any users of the DBG_PHI.
NB, PHI not Phi