mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-24 02:38:42 +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:
parent
e5ab3355ba
commit
a935db8ea2
@ -9131,6 +9131,10 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
|
|||||||
CI.setOperand(0, Intrinsic::getDeclaration(M, MemCpyID));
|
CI.setOperand(0, Intrinsic::getDeclaration(M, MemCpyID));
|
||||||
Changed = true;
|
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
|
// If we can determine a pointer alignment that is bigger than currently
|
||||||
|
@ -34,3 +34,9 @@ define i32 @test3() {
|
|||||||
ret i32 0
|
ret i32 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; PR2370
|
||||||
|
define void @test4(i8* %a) {
|
||||||
|
tail call void @llvm.memmove.i32( i8* %a, i8* %a, i32 100, i32 1 )
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user