Use salvageDebugInfo for instructions erased as trivially dead in
GlobalISel.
It would be helpful to implement support of G_PTR_ADD and G_FRAME_INDEX
in salvageDebugInfo in future in order to preserve more variable
location.
Statistics of llvm object files built with vs without this commit on -O2 optimization level (CMAKE_BUILD_TYPE=RelWithDebInfo, -fglobal-isel) on Aarch64
(macOS):
Number of variables covered by location statistics:
- test-suite GISel - 1074837
- test-suite Patch - 1109099 (+3.18%)
- llvm GISel - 11914074
- llvm Patch - 12356266 (+3.71%)
Number of variables with 100% coverage of parent scope:
- test-suite GISel - 361477
- test-suite Patch - 393043 (+8.73%)
- llvm GISel - 4575700
- llvm GISel+patch - 4858319 (+6.17%)