summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2018-07-31 04:37:11 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2018-07-31 04:37:11 +0000
commiteb8e9c09409b6ec088e3b864749eafd5170482d0 (patch)
tree8de370151f2ed7a8aaf19e6a16df7c4afdb36f77 /llvm/lib/Transforms/Scalar
parent3bd20d460521706269318e81da9f28346bfdb949 (diff)
downloadbcm5719-llvm-eb8e9c09409b6ec088e3b864749eafd5170482d0.tar.gz
bcm5719-llvm-eb8e9c09409b6ec088e3b864749eafd5170482d0.zip
[NFC] Collect statistics in GuardWidening
llvm-svn: 338348
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-rw-r--r--llvm/lib/Transforms/Scalar/GuardWidening.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/GuardWidening.cpp b/llvm/lib/Transforms/Scalar/GuardWidening.cpp
index b939ef359ad..055fcbc8436 100644
--- a/llvm/lib/Transforms/Scalar/GuardWidening.cpp
+++ b/llvm/lib/Transforms/Scalar/GuardWidening.cpp
@@ -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(
OpenPOWER on IntegriCloud