This is an archive of the discontinued LLVM Phabricator instance.

Improve the effectiveness of ADCE's debug info salvaging
ClosedPublic

Authored by aprantl on Sep 24 2021, 5:12 PM.

Details

Summary

This patch improves the effectiveness of ADCE's debug info salvaging by processing the instructions in reverse order and delaying dropAllReferences until after debug info salvaging. This allows salvaging of entire chains of deleted instructions!

Previously we would remove all references from an instruction, which would make it impossible to use that instruction to salvage a later instruction in the instruction stream, because its operands were already removed.

Diff Detail

Event Timeline

aprantl created this revision.Sep 24 2021, 5:12 PM
aprantl requested review of this revision.Sep 24 2021, 5:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 24 2021, 5:12 PM

Cool, thanks!

Can we apply the same for other places where we are salvaging the debugging info, for example - https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Scalar/BDCE.cpp#L109 ?

djtodoro accepted this revision.Sep 28 2021, 2:04 AM

lgtm (please run clang-format), thanks!

This revision is now accepted and ready to land.Sep 28 2021, 2:04 AM
This revision was landed with ongoing or failed builds.Sep 28 2021, 10:25 AM
This revision was automatically updated to reflect the committed changes.