[llvm] Add a pass to collect dropped variable statistics (PR #102233)

Shubham Sandeep Rastogi via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 10:47:34 PDT 2024


rastogishubham wrote:

This patch has been heavily reworked to remove false positives from dead code elimination passes. Now, debug information is only considered dropped if a `#dbg_value` doesn't exist in the `Function` after a pass has run and there exists a real instruction that has the same scope as the `#dbg_value` or a child scope of the `#dbg_value` scope, and the inlinedAt of the instruction is the same as the `#dbg_value` inlinedAt or the `#dbg_value'`s inlinedAt is part of the inlinedAt chain of the instruction's inlinedAt.

When we run this pass on optdriver.cpp, we can see a much more reasonable:

'InstCombinePass', 1
'SimplifyCFGPass', 6
'JumpThreadingPass', 25

Variables being dropped.

https://github.com/llvm/llvm-project/pull/102233


More information about the llvm-commits mailing list