Skip to content

Commit 5873195

Browse files
author
Cameron Zwarich
committed
Add some more statistics to CodeGenPrepare.
llvm-svn: 122891
1 parent db901f2 commit 5873195

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ using namespace llvm;
4545
using namespace llvm::PatternMatch;
4646

4747
STATISTIC(NumBlocksElim, "Number of blocks eliminated");
48+
STATISTIC(NumPHIsElim, "Number of trivial PHIs eliminated");
49+
STATISTIC(NumGEPsElim, "Number of GEPs converted to casts");
4850
STATISTIC(NumCmpUses, "Number of uses of Cmp expressions replaced with uses of "
4951
"sunken Cmps");
5052
STATISTIC(NumCastUses, "Number of uses of Cast expressions replaced with uses "
@@ -981,6 +983,7 @@ bool CodeGenPrepare::OptimizeBlock(BasicBlock &BB) {
981983
if (Value *V = SimplifyInstruction(P)) {
982984
P->replaceAllUsesWith(V);
983985
P->eraseFromParent();
986+
++NumPHIsElim;
984987
}
985988
} else if (CastInst *CI = dyn_cast<CastInst>(I)) {
986989
// If the source of the cast is a constant, then this should have
@@ -1020,6 +1023,7 @@ bool CodeGenPrepare::OptimizeBlock(BasicBlock &BB) {
10201023
GEPI->getName(), GEPI);
10211024
GEPI->replaceAllUsesWith(NC);
10221025
GEPI->eraseFromParent();
1026+
++NumGEPsElim;
10231027
MadeChange = true;
10241028
BBI = NC;
10251029
}

0 commit comments

Comments
 (0)