[llvm-commits] [llvm] r122891 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp

Cameron Zwarich zwarich at apple.com
Wed Jan 5 09:47:38 PST 2011


Author: zwarich
Date: Wed Jan  5 11:47:38 2011
New Revision: 122891

URL: http://llvm.org/viewvc/llvm-project?rev=122891&view=rev
Log:
Add some more statistics to CodeGenPrepare.

Modified:
    llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=122891&r1=122890&r2=122891&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Wed Jan  5 11:47:38 2011
@@ -45,6 +45,8 @@
 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 @@
       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 @@
                                           GEPI->getName(), GEPI);
         GEPI->replaceAllUsesWith(NC);
         GEPI->eraseFromParent();
+        ++NumGEPsElim;
         MadeChange = true;
         BBI = NC;
       }





More information about the llvm-commits mailing list