This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel][DebugInfo] Salvage trivially dead instructions
ClosedPublic

Authored by dzhidzhoev on Sep 15 2022, 4:14 PM.

Details

Summary

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%)

Diff Detail

Event Timeline

dzhidzhoev created this revision.Sep 15 2022, 4:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 15 2022, 4:14 PM
dzhidzhoev requested review of this revision.Sep 15 2022, 4:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 15 2022, 4:14 PM
arsenm accepted this revision.Sep 16 2022, 9:01 AM

LGTM

This revision is now accepted and ready to land.Sep 16 2022, 9:01 AM
This revision was landed with ongoing or failed builds.Sep 16 2022, 5:55 PM
This revision was automatically updated to reflect the committed changes.