aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/InstCombine/InstCombineCalls.cpp
diff options
context:
space:
mode:
authorMeador Inge <meadori@codesourcery.com>2012-11-30 04:05:06 +0000
committerMeador Inge <meadori@codesourcery.com>2012-11-30 04:05:06 +0000
commit63f932ca3c91ea8ac5b592158f5e8ef7de550547 (patch)
tree70d968d775fd1e96f2a6bd4002cf9bddfc8780ba /lib/Transforms/InstCombine/InstCombineCalls.cpp
parent84bcf93e0fd225de2217d1b712c01586a633a6d8 (diff)
downloadexternal_llvm-63f932ca3c91ea8ac5b592158f5e8ef7de550547.zip
external_llvm-63f932ca3c91ea8ac5b592158f5e8ef7de550547.tar.gz
external_llvm-63f932ca3c91ea8ac5b592158f5e8ef7de550547.tar.bz2
Move library call simplification statistic to instcombine
The simplify-libcalls pass maintained a statistic to count the number of library calls that have been simplified. Now that library call simplification is being carried out in instcombine the statistic should be moved to there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168975 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineCalls.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstCombineCalls.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp
index b7b45a2..60244c7 100644
--- a/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -14,11 +14,14 @@
#include "InstCombine.h"
#include "llvm/Support/CallSite.h"
#include "llvm/DataLayout.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/MemoryBuiltins.h"
#include "llvm/Transforms/Utils/BuildLibCalls.h"
#include "llvm/Transforms/Utils/Local.h"
using namespace llvm;
+STATISTIC(NumSimplified, "Number of library calls simplified");
+
/// getPromotedType - Return the specified type promoted as it would be to pass
/// though a va_arg area.
static Type *getPromotedType(Type *Ty) {
@@ -785,8 +788,10 @@ static bool isSafeToEliminateVarargsCast(const CallSite CS,
Instruction *InstCombiner::tryOptimizeCall(CallInst *CI, const DataLayout *TD) {
if (CI->getCalledFunction() == 0) return 0;
- if (Value *With = Simplifier->optimizeCall(CI))
+ if (Value *With = Simplifier->optimizeCall(CI)) {
+ ++NumSimplified;
return CI->use_empty() ? CI : ReplaceInstUsesWith(*CI, With);
+ }
return 0;
}