summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-08-27 16:26:13 +0000
committerDan Gohman <gohman@apple.com>2007-08-27 16:26:13 +0000
commit8dc0b931515d45366f7044f5a3b7aeb27975bae4 (patch)
treecdda2ed8e0c68087a6f92461c25d7f32428bf3da /llvm/test/CodeGen
parent71eaf62e5f0b99fb4b25963dc5cdcdd2c222e771 (diff)
downloadbcm5719-llvm-8dc0b931515d45366f7044f5a3b7aeb27975bae4.tar.gz
bcm5719-llvm-8dc0b931515d45366f7044f5a3b7aeb27975bae4.zip
If the source and destination pointers in an llvm.memmove are known
to not alias each other, it can be translated as an llvm.memcpy. llvm-svn: 41489
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/X86/memmove-0.ll9
-rw-r--r--llvm/test/CodeGen/X86/memmove-1.ll9
-rw-r--r--llvm/test/CodeGen/X86/memmove-2.ll9
-rw-r--r--llvm/test/CodeGen/X86/memmove-3.ll9
4 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/memmove-0.ll b/llvm/test/CodeGen/X86/memmove-0.ll
new file mode 100644
index 00000000000..4632aaae72f
--- /dev/null
+++ b/llvm/test/CodeGen/X86/memmove-0.ll
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llc -march=x86 | grep {call 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
+}
diff --git a/llvm/test/CodeGen/X86/memmove-1.ll b/llvm/test/CodeGen/X86/memmove-1.ll
new file mode 100644
index 00000000000..e19ba6f38bc
--- /dev/null
+++ b/llvm/test/CodeGen/X86/memmove-1.ll
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llc -march=x86 | grep {call 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
+}
diff --git a/llvm/test/CodeGen/X86/memmove-2.ll b/llvm/test/CodeGen/X86/memmove-2.ll
new file mode 100644
index 00000000000..bb5485ffd9a
--- /dev/null
+++ b/llvm/test/CodeGen/X86/memmove-2.ll
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llc -march=x86 | 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
+}
diff --git a/llvm/test/CodeGen/X86/memmove-3.ll b/llvm/test/CodeGen/X86/memmove-3.ll
new file mode 100644
index 00000000000..5e07eade376
--- /dev/null
+++ b/llvm/test/CodeGen/X86/memmove-3.ll
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llc -march=x86 | grep {call 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
+}
OpenPOWER on IntegriCloud