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

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 07:14:09 PDT 2024


https://github.com/jmorse commented:

LGTM, although I'd suggest you want a test to check that nothing is printed when nothing is dropped (such as when the verifier runs), purely as a sanity-check. Thanks for working on this!

What's motivated using the line-number to identify a variable, instead of using the DILocalVariable directly? There's the `DebugVariable` class out there that exists for variable-identity purposes, it even has fragment-handling built in.

In this implementation "dropped" is meaning "all the records of its location disappear" as opposed to "it's completely optimised away and all the records have an undef/poison value". I think sometimes we use the terms interchangeably, the former seems like the most useful in this context though.

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


More information about the llvm-commits mailing list