From: Max Kazantsev Date: Tue, 31 Jul 2018 04:37:11 +0000 (+0000) Subject: [NFC] Collect statistics in GuardWidening X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b661d1f712282862de22a0cc11f2f3ca8620534;p=llvm [NFC] Collect statistics in GuardWidening git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338348 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/GuardWidening.cpp b/lib/Transforms/Scalar/GuardWidening.cpp index b939ef359ad..055fcbc8436 100644 --- a/lib/Transforms/Scalar/GuardWidening.cpp +++ b/lib/Transforms/Scalar/GuardWidening.cpp @@ -43,6 +43,7 @@ #include #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(