diff options
author | Chris Lattner <sabre@nondot.org> | 2002-05-10 15:38:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-05-10 15:38:35 +0000 |
commit | 3dec1f272219ee1f8e1499929cdf53f5bc3c2272 (patch) | |
tree | 5f1b55fbf194e79beb850cf398cc39d13071c0d7 /lib/Transforms/Scalar/ConstantProp.cpp | |
parent | 55547274bc3ef98165275da8b0f9af24c268dcf5 (diff) |
Add support for printing out statistics information when -stats is added to
the command line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2601 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/ConstantProp.cpp')
-rw-r--r-- | lib/Transforms/Scalar/ConstantProp.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/ConstantProp.cpp b/lib/Transforms/Scalar/ConstantProp.cpp index 7598afe32b..013ddc0107 100644 --- a/lib/Transforms/Scalar/ConstantProp.cpp +++ b/lib/Transforms/Scalar/ConstantProp.cpp @@ -19,6 +19,9 @@ #include "llvm/Support/InstIterator.h" #include <set> +#include "Support/StatisticReporter.h" +static Statistic<> NumInstKilled("constprop - Number of instructions killed"); + namespace { struct ConstantPropogation : public FunctionPass { const char *getPassName() const { return "Simple Constant Propogation"; } @@ -55,9 +58,10 @@ bool ConstantPropogation::runOnFunction(Function *F) { // Replace all of the uses of a variable with uses of the constant. I->replaceAllUsesWith(C); - + // We made a change to the function... Changed = true; + ++NumInstKilled; } } return Changed; |