[NFC] Collect statistics in GuardWidening

llvm-svn: 338348
This commit is contained in:
Max Kazantsev 2018-07-31 04:37:11 +00:00
parent 3bd20d4605
commit eb8e9c0940
1 changed files with 4 additions and 0 deletions

View File

@ -43,6 +43,7 @@
#include <functional>
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/PostDominators.h"
@ -61,6 +62,8 @@ using namespace llvm;
#define DEBUG_TYPE "guard-widening"
STATISTIC(GuardsEliminated, "Number of eliminated guards");
namespace {
class GuardWideningImpl {
@ -362,6 +365,7 @@ bool GuardWideningImpl::isGuard(const Instruction* I) {
void GuardWideningImpl::eliminateGuard(Instruction *GuardInst) {
GuardInst->eraseFromParent();
++GuardsEliminated;
}
GuardWideningImpl::WideningScore GuardWideningImpl::computeWideningScore(