mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-03 13:31:05 +00:00
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
This commit is contained in:
parent
f0d568d38b
commit
05cd03b335
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user