[llvm-commits] [llvm] r118789 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp test/CodeGen/X86/memmove-0.ll test/CodeGen/X86/memmove-1.ll test/CodeGen/X86/memmove-2.ll test/CodeGen/X86/memmove-3.ll
Dan Gohman
gohman at apple.com
Thu Nov 11 08:24:49 PST 2010
Author: djg
Date: Thu Nov 11 10:24:49 2010
New Revision: 118789
URL: http://llvm.org/viewvc/llvm-project?rev=118789&view=rev
Log:
Remove the memmove->memcpy optimization from CodeGen. MemCpyOpt does this.
Removed:
llvm/trunk/test/CodeGen/X86/memmove-0.ll
llvm/trunk/test/CodeGen/X86/memmove-1.ll
llvm/trunk/test/CodeGen/X86/memmove-2.ll
llvm/trunk/test/CodeGen/X86/memmove-3.ll
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=118789&r1=118788&r2=118789&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Thu Nov 11 10:24:49 2010
@@ -4086,20 +4086,6 @@
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))));
Removed: llvm/trunk/test/CodeGen/X86/memmove-0.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/memmove-0.ll?rev=118788&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/memmove-0.ll (original)
+++ llvm/trunk/test/CodeGen/X86/memmove-0.ll (removed)
@@ -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
-}
Removed: llvm/trunk/test/CodeGen/X86/memmove-1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/memmove-1.ll?rev=118788&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/memmove-1.ll (original)
+++ llvm/trunk/test/CodeGen/X86/memmove-1.ll (removed)
@@ -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
-}
Removed: llvm/trunk/test/CodeGen/X86/memmove-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/memmove-2.ll?rev=118788&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/memmove-2.ll (original)
+++ llvm/trunk/test/CodeGen/X86/memmove-2.ll (removed)
@@ -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
-}
Removed: llvm/trunk/test/CodeGen/X86/memmove-3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/memmove-3.ll?rev=118788&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/memmove-3.ll (original)
+++ llvm/trunk/test/CodeGen/X86/memmove-3.ll (removed)
@@ -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
-}
More information about the llvm-commits
mailing list