From 46234fd97f1747b9f2cfce16e68bda3bf150bb3e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 15 Mar 2004 05:46:59 +0000 Subject: [PATCH] Add counters for the number of calls elimianted git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12420 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/GCSE.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Transforms/Scalar/GCSE.cpp b/lib/Transforms/Scalar/GCSE.cpp index eb74b7c0a44..e949525d80d 100644 --- a/lib/Transforms/Scalar/GCSE.cpp +++ b/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(I)) ++NumLoadRemoved; // Keep track of loads eliminated + if (isa(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(Ret)) ++NumLoadRemoved; // Keep track of loads eliminated + if (isa(Ret)) + ++NumCallRemoved; // Keep track of calls eliminated ++NumInstRemoved; // Keep track of number of instructions eliminated // Add all users of Ret to the worklist...