diff options
author | Cameron Zwarich <zwarich@apple.com> | 2011-01-05 17:47:38 +0000 |
---|---|---|
committer | Cameron Zwarich <zwarich@apple.com> | 2011-01-05 17:47:38 +0000 |
commit | b62ccb241b7e991c63e14bf716762f3cdd459fad (patch) | |
tree | 29ec9b4e77f31643f992b6a097cbf7cf79a44bcd /llvm/lib | |
parent | eb29d18e5da3452d57891135dcfadd5e8eac5102 (diff) | |
download | bcm5719-llvm-b62ccb241b7e991c63e14bf716762f3cdd459fad.tar.gz bcm5719-llvm-b62ccb241b7e991c63e14bf716762f3cdd459fad.zip |
Add some more statistics to CodeGenPrepare.
llvm-svn: 122891
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp index 6919a96f833..1f842fb4f8f 100644 --- a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/llvm/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; } |