opt has a flag -analyze which prints some debug information for analyses that are run. This is done via Pass::print() within the pass manager.
This isn’t implemented in NPM and since NPM is not so much into subclassing, it’s a bit awkward (but somewhat doable) to implement. Probably a better alternative is to separate out the debug printing into a flag, or into another pass. For example, some tests in Analysis/RegionInfo run opt -regions -analyze
for LPM, and opt -passes='print<regions>'
to test under NPM.
This is responsible for a significant amount of the remaining check-llvm failures under NPM. I’d like to deprecate -analyze and migrate passes to either use a separate flag or pass to print extra info. Any comments?
One tricky part about this is the existence of update_analyze_test_checks.py. It uses some of the logs printed (per function) by the -analyze infra to help with updating CHECK lines. This is only used in ScalarEvolution and CostModel tests. If we decide to separate out the -analyze printing for those passes into a separate flag/pass, we could make those two passes mimic -analyze’s logging to continue being able to use update_analyze_test_checks.py if that’s really wanted.