summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorFedor Sergeev <fedor.sergeev@azul.com>2018-10-17 09:02:54 +0000
committerFedor Sergeev <fedor.sergeev@azul.com>2018-10-17 09:02:54 +0000
commitc297e84b97545d3eac787e2598b191a3d6034145 (patch)
tree4e6bff53450eff0784444a8e283b5ee329d7ce2a /llvm
parentc014d863bee8bcef8fbb6bc98564bfd820e38b64 (diff)
downloadbcm5719-llvm-c297e84b97545d3eac787e2598b191a3d6034145.tar.gz
bcm5719-llvm-c297e84b97545d3eac787e2598b191a3d6034145.zip
[LoopPredication] add some simple stats
Just adding some useful statistics to LoopPredication pass which was lacking any of these. llvm-svn: 344681
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopPredication.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopPredication.cpp b/llvm/lib/Transforms/Scalar/LoopPredication.cpp
index cbb6594cf8f..ccaf10142d5 100644
--- a/llvm/lib/Transforms/Scalar/LoopPredication.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopPredication.cpp
@@ -178,6 +178,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/Scalar/LoopPredication.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopPass.h"
@@ -196,6 +197,9 @@
#define DEBUG_TYPE "loop-predication"
+STATISTIC(TotalConsidered, "Number of guards considered");
+STATISTIC(TotalWidened, "Number of checks widened");
+
using namespace llvm;
static cl::opt<bool> EnableIVTruncation("loop-predication-enable-iv-truncation",
@@ -574,6 +578,8 @@ bool LoopPredication::widenGuardConditions(IntrinsicInst *Guard,
LLVM_DEBUG(dbgs() << "Processing guard:\n");
LLVM_DEBUG(Guard->dump());
+ TotalConsidered++;
+
IRBuilder<> Builder(cast<Instruction>(Preheader->getTerminator()));
// The guard condition is expected to be in form of:
@@ -615,6 +621,8 @@ bool LoopPredication::widenGuardConditions(IntrinsicInst *Guard,
if (NumWidened == 0)
return false;
+ TotalWidened += NumWidened;
+
// Emit the new guard condition
Builder.SetInsertPoint(Guard);
Value *LastCheck = nullptr;
OpenPOWER on IntegriCloud