mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-04 21:30:49 +00:00
Revert r50441. The original code was correct. Add some more comments so that I don't make the same mistake in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50446 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9dcace3caf
commit
02e9988020
@ -668,18 +668,24 @@ bool MemCpyOpt::processMemCpy(MemCpyInst* M) {
|
||||
|
||||
CallInst* C = CallInst::Create(MemCpyFun, args.begin(), args.end(), "", M);
|
||||
|
||||
|
||||
// If C and M don't interfere, then this is a valid transformation. If they
|
||||
// did, this would mean that the two sources overlap, which would be bad.
|
||||
if (MD.getDependency(C) == MDep) {
|
||||
MD.dropInstruction(M);
|
||||
M->eraseFromParent();
|
||||
|
||||
NumMemCpyInstr++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Otherwise, there was no point in doing this, so we remove the call we
|
||||
// inserted and act like nothing happened.
|
||||
MD.removeInstruction(C);
|
||||
C->eraseFromParent();
|
||||
|
||||
NumMemCpyInstr++;
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// MemCpyOpt::runOnFunction - This is the main transformation entry point for a
|
||||
|
Loading…
Reference in New Issue
Block a user