mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-22 10:24:26 +00:00
Implement PR2370: memmove(x,x,size) -> noop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51636 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -9131,6 +9131,10 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
|
||||
CI.setOperand(0, Intrinsic::getDeclaration(M, MemCpyID));
|
||||
Changed = true;
|
||||
}
|
||||
|
||||
// memmove(x,x,size) -> noop.
|
||||
if (MMI->getSource() == MMI->getDest())
|
||||
return EraseInstFromFunction(CI);
|
||||
}
|
||||
|
||||
// If we can determine a pointer alignment that is bigger than currently
|
||||
|
Reference in New Issue
Block a user