[llvm-dev] opt's -analyze feature and NPM

Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 13 18:38:55 PDT 2020

On 7/13/20 6:39 PM, Arthur Eubanks via llvm-dev wrote:
> 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 
> <https://bugs.llvm.org/show_bug.cgi?id=46651>. I'd like to deprecate 
> -analyze and migrate passes to either use a separate flag or pass to 
> print extra info. Any comments?

I think that, whatever the mechanism, we should make it uniform across 
the passes. print<regions>, print<scev>, print<cost-model> (or whatever) 
seems fine to me.


> 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.
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200713/3b95b7ff/attachment.html>

More information about the llvm-dev mailing list