[llvm] [DebugInfo][X86] Use merged DebugLoc in replaceBranchWithTailCall (PR #189509)
Stephen Tozer via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 31 02:56:18 PDT 2026
SLTozer wrote:
Referencing the [How to Update Debug Info](https://llvm.org/docs/HowToUpdateDebugInfo.html#when-to-merge-instruction-locations) document, this seems closes to the "Hoisting/sinking that would make a location reachable when it previously wasn’t" case, which recommends dropping the location (of the call); if we were to then merge, we'd always get an empty location. I agree however that pragmatically in this case it seems like we'd have strictly more useful information if we just kept the location of the branch instruction - "merging" means erasing enough information for the resulting location to be ambiguous, but in this case there is no ambiguity at least that the condbr is stepped on. We should probably put together an explicit rule for this in the document so that this isn't all pragmatism and guess-work, but I probably agree with keeping the condbr location.
NB: We could do even better than this with line table extensions in DWARF, so this may be worth revisiting as those become available.
https://github.com/llvm/llvm-project/pull/189509
More information about the llvm-commits
mailing list