summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-15 05:46:59 +0000
committerChris Lattner <sabre@nondot.org>2004-03-15 05:46:59 +0000
commitcd83282df1fae2a4f5be101e66bbdc73e1fc875b (patch)
treef1754175ffecacbb03b83994de1222312e05bbb0 /llvm/lib
parent53a3587997db80d46840ea1bdd36e27bdcf65591 (diff)
downloadbcm5719-llvm-cd83282df1fae2a4f5be101e66bbdc73e1fc875b.tar.gz
bcm5719-llvm-cd83282df1fae2a4f5be101e66bbdc73e1fc875b.zip
Add counters for the number of calls elimianted
llvm-svn: 12420
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/GCSE.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/GCSE.cpp b/llvm/lib/Transforms/Scalar/GCSE.cpp
index eb74b7c0a44..e949525d80d 100644
--- a/llvm/lib/Transforms/Scalar/GCSE.cpp
+++ b/llvm/lib/Transforms/Scalar/GCSE.cpp
@@ -16,6 +16,7 @@
#include "llvm/Transforms/Scalar.h"
#include "llvm/iMemory.h"
+#include "llvm/iOther.h"
#include "llvm/Type.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/ValueNumbering.h"
@@ -28,6 +29,7 @@ using namespace llvm;
namespace {
Statistic<> NumInstRemoved("gcse", "Number of instructions removed");
Statistic<> NumLoadRemoved("gcse", "Number of loads removed");
+ Statistic<> NumCallRemoved("gcse", "Number of calls removed");
Statistic<> NumNonInsts ("gcse", "Number of instructions removed due "
"to non-instruction values");
@@ -123,6 +125,8 @@ bool GCSE::EliminateRedundancies(Instruction *I,
if (isa<LoadInst>(I))
++NumLoadRemoved; // Keep track of loads eliminated
+ if (isa<CallInst>(I))
+ ++NumCallRemoved; // Keep track of calls eliminated
++NumInstRemoved; // Keep track of number of instructions eliminated
++NumNonInsts; // Keep track of number of insts repl with values
@@ -264,6 +268,8 @@ Instruction *GCSE::EliminateCSE(Instruction *I, Instruction *Other) {
if (isa<LoadInst>(Ret))
++NumLoadRemoved; // Keep track of loads eliminated
+ if (isa<CallInst>(Ret))
+ ++NumCallRemoved; // Keep track of calls eliminated
++NumInstRemoved; // Keep track of number of instructions eliminated
// Add all users of Ret to the worklist...
OpenPOWER on IntegriCloud