[llvm-commits] CVS: llvm/lib/Transforms/Scalar/GCSE.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Mar 15 00:01:21 PST 2004


Changes in directory llvm/lib/Transforms/Scalar:

GCSE.cpp updated: 1.34 -> 1.35

---
Log message:

Add counters for the number of calls elimianted


---
Diffs of the changes:  (+6 -0)

Index: llvm/lib/Transforms/Scalar/GCSE.cpp
diff -u llvm/lib/Transforms/Scalar/GCSE.cpp:1.34 llvm/lib/Transforms/Scalar/GCSE.cpp:1.35
--- llvm/lib/Transforms/Scalar/GCSE.cpp:1.34	Thu Feb  5 16:33:19 2004
+++ llvm/lib/Transforms/Scalar/GCSE.cpp	Sun Mar 14 23:46:59 2004
@@ -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 @@
 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 @@
 
           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 @@
 
   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...





More information about the llvm-commits mailing list