1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Remove the memmove->memcpy optimization from CodeGen. MemCpyOpt does this.

llvm-svn: 118789
This commit is contained in:
Dan Gohman 2010-11-11 16:24:49 +00:00
parent 01ed16d764
commit 8e986f9c2f
5 changed files with 0 additions and 50 deletions

View File

@ -4086,20 +4086,6 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
SDValue Op3 = getValue(I.getArgOperand(2));
unsigned Align = cast<ConstantInt>(I.getArgOperand(3))->getZExtValue();
bool isVol = cast<ConstantInt>(I.getArgOperand(4))->getZExtValue();
// If the source and destination are known to not be aliases, we can
// lower memmove as memcpy.
uint64_t Size = -1ULL;
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op3))
Size = C->getZExtValue();
if (AA->alias(I.getArgOperand(0), Size, I.getArgOperand(1), Size) ==
AliasAnalysis::NoAlias) {
DAG.setRoot(DAG.getMemcpy(getRoot(), dl, Op1, Op2, Op3, Align, isVol,
false, MachinePointerInfo(I.getArgOperand(0)),
MachinePointerInfo(I.getArgOperand(1))));
return 0;
}
DAG.setRoot(DAG.getMemmove(getRoot(), dl, Op1, Op2, Op3, Align, isVol,
MachinePointerInfo(I.getArgOperand(0)),
MachinePointerInfo(I.getArgOperand(1))));

View File

@ -1,9 +0,0 @@
; RUN: llc < %s -march=x86 -mtriple=i686-pc-linux-gnu | grep {calll memcpy}
declare void @llvm.memmove.i64(i8* %d, i8* %s, i64 %l, i32 %a)
define void @foo(i8* noalias %d, i8* noalias %s, i64 %l)
{
call void @llvm.memmove.i64(i8* %d, i8* %s, i64 %l, i32 1)
ret void
}

View File

@ -1,9 +0,0 @@
; RUN: llc < %s -march=x86 -mtriple=i686-pc-linux-gnu | grep {calll memmove}
declare void @llvm.memmove.i64(i8* %d, i8* %s, i64 %l, i32 %a)
define void @foo(i8* %d, i8* %s, i64 %l)
{
call void @llvm.memmove.i64(i8* %d, i8* %s, i64 %l, i32 1)
ret void
}

View File

@ -1,9 +0,0 @@
; RUN: llc < %s -march=x86 -mtriple=i686-pc-linux-gnu | not grep call
declare void @llvm.memmove.i64(i8* %d, i8* %s, i64 %l, i32 %a)
define void @foo(i8* noalias %d, i8* noalias %s)
{
call void @llvm.memmove.i64(i8* %d, i8* %s, i64 32, i32 1)
ret void
}

View File

@ -1,9 +0,0 @@
; RUN: llc < %s -march=x86 -mtriple=i686-pc-linux-gnu | grep {calll memmove}
declare void @llvm.memmove.i64(i8* %d, i8* %s, i64 %l, i32 %a)
define void @foo(i8* %d, i8* %s)
{
call void @llvm.memmove.i64(i8* %d, i8* %s, i64 32, i32 1)
ret void
}