aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-01-05 17:47:38 +0000
committerCameron Zwarich <zwarich@apple.com>2011-01-05 17:47:38 +0000
commit073057f0d0a1e21ab020fa71ff4bd11543faa6d0 (patch)
tree6846dcc6dbbfa63065bc15099b1f9956278f3082 /lib/Transforms/Scalar/CodeGenPrepare.cpp
parent3d2148f5ace1292dcc12c37e9d0e13dee5220a5a (diff)
Add some more statistics to CodeGenPrepare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122891 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/CodeGenPrepare.cpp')
-rw-r--r--lib/Transforms/Scalar/CodeGenPrepare.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp
index 6919a96f83..1f842fb4f8 100644
--- a/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp
@@ -45,6 +45,8 @@ using namespace llvm;
using namespace llvm::PatternMatch;
STATISTIC(NumBlocksElim, "Number of blocks eliminated");
+STATISTIC(NumPHIsElim, "Number of trivial PHIs eliminated");
+STATISTIC(NumGEPsElim, "Number of GEPs converted to casts");
STATISTIC(NumCmpUses, "Number of uses of Cmp expressions replaced with uses of "
"sunken Cmps");
STATISTIC(NumCastUses, "Number of uses of Cast expressions replaced with uses "
@@ -981,6 +983,7 @@ bool CodeGenPrepare::OptimizeBlock(BasicBlock &BB) {
if (Value *V = SimplifyInstruction(P)) {
P->replaceAllUsesWith(V);
P->eraseFromParent();
+ ++NumPHIsElim;
}
} else if (CastInst *CI = dyn_cast<CastInst>(I)) {
// If the source of the cast is a constant, then this should have
@@ -1020,6 +1023,7 @@ bool CodeGenPrepare::OptimizeBlock(BasicBlock &BB) {
GEPI->getName(), GEPI);
GEPI->replaceAllUsesWith(NC);
GEPI->eraseFromParent();
+ ++NumGEPsElim;
MadeChange = true;
BBI = NC;
}