aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-09-03 13:37:16 +0000
committerDuncan Sands <baldrick@free.fr>2009-09-03 13:37:16 +0000
commit05cd03b33559732f8ed55e5ff7554fd06d59eb6a (patch)
treefaf61b396c9fe54243d7fe1664a774d15e525265
parentf0d568d38b24cc157861b9cd1dc993efe07b3fe9 (diff)
downloadexternal_llvm-05cd03b33559732f8ed55e5ff7554fd06d59eb6a.zip
external_llvm-05cd03b33559732f8ed55e5ff7554fd06d59eb6a.tar.gz
external_llvm-05cd03b33559732f8ed55e5ff7554fd06d59eb6a.tar.bz2
Keep track of how many memmove calls were turned into
memcpy calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80915 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/MemCpyOptimizer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/lib/Transforms/Scalar/MemCpyOptimizer.cpp
index fd74a03..d6b1585 100644
--- a/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+++ b/lib/Transforms/Scalar/MemCpyOptimizer.cpp
@@ -31,6 +31,7 @@ using namespace llvm;
STATISTIC(NumMemCpyInstr, "Number of memcpy instructions deleted");
STATISTIC(NumMemSetInfer, "Number of memsets inferred");
+STATISTIC(NumMoveToCpy, "Number of memmoves converted to memcpy");
/// isBytewiseValue - If the specified value can be set by repeating the same
/// byte in memory, return the i8 value that it is represented with. This is
@@ -728,10 +729,12 @@ bool MemCpyOpt::processMemMove(MemMoveInst *M) {
Module *Mod = M->getParent()->getParent()->getParent();
const Type *Ty = M->getLength()->getType();
M->setOperand(0, Intrinsic::getDeclaration(Mod, Intrinsic::memcpy, &Ty, 1));
-
+
// MemDep may have over conservative information about this instruction, just
// conservatively flush it from the cache.
getAnalysis<MemoryDependenceAnalysis>().removeInstruction(M);
+
+ ++NumMoveToCpy;
return true;
}