[Debugify] Optimize debugify original mode
authorDjordje Todorovic <djordje.todorovic@syrmia.com>
Tue, 22 Mar 2022 09:14:36 +0000 (10:14 +0100)
committerDjordje Todorovic <djordje.todorovic@syrmia.com>
Tue, 22 Mar 2022 11:14:00 +0000 (12:14 +0100)
commit73777b4c35a390617cce0f6b4516e98fe5a88df1
tree5445a11cca447f2a6849ee6ba69cb6e7ec0c986e
parentebec5e5c8f120ab97f4f05a68e4753508349ad3c
[Debugify] Optimize debugify original mode

Before we start addressing the issue with having
a lot of false positives when using debugify in
the original mode, we have made a few patches that
should speed up the execution of the testing
utility Passes.

For example, when testing a large project
(let's say LLVM project itself), we can face
a lot of potential DI issues. Usually, we use
-verify-each-debuginfo-preserve (that is very
similar to -debugify-each) -- it collects
DI metadata before each Pass, and after the Pass
it checks if the Pass preserved the DI metadata.
However, we can speed up this process, since we
don't need to collect DI metadata before each
Pass -- we could use the DI metadata that are
collected after the previous Pass from
the pipeline as an input for the next Pass.

This patch speeds up the utility for ~2x.

Differential Revision: https://reviews.llvm.org/D115622
clang/lib/CodeGen/BackendUtil.cpp
llvm/include/llvm/Transforms/Utils/Debugify.h
llvm/lib/Transforms/Utils/Debugify.cpp
llvm/tools/opt/opt.cpp
llvm/unittests/Transforms/Utils/DebugifyTest.cpp