mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an
arbitrary integer width for the count. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59823 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -427,9 +427,12 @@ bool MemCpyOpt::processStore(StoreInst *SI, BasicBlock::iterator& BBI) {
|
||||
// instruction needed by the start of the block.
|
||||
BasicBlock::iterator InsertPt = BI;
|
||||
|
||||
if (MemSetF == 0)
|
||||
if (MemSetF == 0) {
|
||||
const Type *Tys[] = {Type::Int64Ty};
|
||||
MemSetF = Intrinsic::getDeclaration(SI->getParent()->getParent()
|
||||
->getParent(), Intrinsic::memset_i64);
|
||||
->getParent(), Intrinsic::memset,
|
||||
Tys, 1);
|
||||
}
|
||||
|
||||
// Get the starting pointer of the block.
|
||||
StartPtr = Range.StartPtr;
|
||||
@ -671,9 +674,11 @@ bool MemCpyOpt::processMemCpy(MemCpyInst* M) {
|
||||
return false;
|
||||
|
||||
// If all checks passed, then we can transform these memcpy's
|
||||
const Type *Tys[1];
|
||||
Tys[0] = M->getLength()->getType();
|
||||
Function* MemCpyFun = Intrinsic::getDeclaration(
|
||||
M->getParent()->getParent()->getParent(),
|
||||
M->getIntrinsicID());
|
||||
M->getIntrinsicID(), Tys, 1);
|
||||
|
||||
std::vector<Value*> args;
|
||||
args.push_back(M->getRawDest());
|
||||
|
Reference in New Issue
Block a user