Print out DebugCounter info with -print-debug-counter
authorZhizhou Yang <zhizhouyang@gmail.com>
Tue, 23 Oct 2018 21:51:56 +0000 (21:51 +0000)
committerZhizhou Yang <zhizhouyang@gmail.com>
Tue, 23 Oct 2018 21:51:56 +0000 (21:51 +0000)
commit13f76f84bc8f6a0bad31f56639a12f43f938b0b9
treed90f240f285ff923829f659ae7c9e89234a7fd71
parent3ef53e10d3a6bdefdf6e0974775ca0edafc5a91d
Print out DebugCounter info with -print-debug-counter

Summary:
This patch will print out {Counter, Skip, StopAfter} info of all passes which have DebugCounter set at destruction.

It can be used to monitor how many times does certain transformation happen in a pass, and also help check if -debug-counter option is set correctly.

Please refer to this [[ http://lists.llvm.org/pipermail/llvm-dev/2018-July/124722.html  | thread ]] for motivation.

Reviewers: george.burgess.iv, davide, greened

Reviewed By: greened

Subscribers: kristina, llozano, mgorny, llvm-commits, mgrang

Differential Revision: https://reviews.llvm.org/D50031

llvm-svn: 345085
llvm/include/llvm/Support/DebugCounter.h
llvm/lib/Support/DebugCounter.cpp
llvm/test/Other/print-debug-counter.ll [new file with mode: 0644]