Improve the effectiveness of BDCE's debug info salvaging
authorAdrian Prantl <aprantl@apple.com>
Mon, 27 Sep 2021 17:51:04 +0000 (10:51 -0700)
committerAdrian Prantl <aprantl@apple.com>
Tue, 28 Sep 2021 17:24:51 +0000 (10:24 -0700)
commitf6954bf80472cbfc06e39dac75a4a72120c9bd15
tree84a323e4a11b0155c0f1779f65f98c3e06c6613b
parent9637b045e6eee71cd34f0f2f80a2ae1ad2a71129
Improve the effectiveness of BDCE's debug info salvaging

This patch improves the effectiveness of BDCE'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.

Differential Revision: https://reviews.llvm.org/D110568
llvm/lib/Transforms/Scalar/BDCE.cpp
llvm/test/Transforms/Util/salvage-debuginfo.ll