[PATCH] D115714: [Debugify] Limit number of processed instructions for original mode

Nikola Tesic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 14 01:42:15 PST 2021


ntesic created this revision.
ntesic added reviewers: Orlando, StephenTozer, djtodoro.
ntesic added a project: debug-info.
Herald added a subscriber: hiraditya.
ntesic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Debugify in OriginalDebugInfo mode, does (DebugInfo) collect-before-pass & check-after-pass
for each instruction, which is pretty expensive. When used to analyze DebugInfo losses
in large projects (like LLVM), this raises the build time unacceptably.
This patch introduces a limit for the number of processed instructions.
The default value is 10000 instructions per compile unit (per pass),
which is experimentally derived, based on LLVM & binutils-gdb builds.

Additionally, the -debugify-instr-limit option could be used to specify
the level of limitation as:

- zero - sets the level to 0 (practically turns off the utility),
- unlimited - sets the level to UINT_MAX (practically turns off the limitation),
- default - sets the level to 10000 instructions.

This patch speeds up the utility 3-4 times.


https://reviews.llvm.org/D115714

Files:
  llvm/lib/Transforms/Utils/Debugify.cpp
  llvm/test/Transforms/Util/Debugify/loc-only-original-mode.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115714.394181.patch
Type: text/x-patch
Size: 3926 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211214/424d22e8/attachment.bin>


More information about the llvm-commits mailing list