[SimplifyCFG] Update debug location when folding branch to common destination
authorDavide Italiano <ditaliano@apple.com>
Thu, 18 Jun 2020 19:33:02 +0000 (12:33 -0700)
committerDavide Italiano <ditaliano@apple.com>
Thu, 18 Jun 2020 19:33:32 +0000 (12:33 -0700)
commit8cdd2a158c9cc94ad265fe4f0d45edd3bf916b6f
tree1fc49957642a90932776b7ba1861a4fed41a1acb
parent1b2f6b4a08ba74d965dcf7c9fee97d286c0250f8
[SimplifyCFG] Update debug location when folding branch to common destination

Sometimes a dead block gets folded and the debug information is still
retained. This manifests as jumpy stepping in lldb, see the bugzilla PR
for an end-to-end C testcase.

Fixes https://bugs.llvm.org/show_bug.cgi?id=46008

Differential Revision:  https://reviews.llvm.org/D82062
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/basictest.ll
llvm/test/Transforms/SimplifyCFG/fold-debug-location.ll [new file with mode: 0644]