[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/memmove.ll
Chris Lattner
lattner at cs.uiuc.edu
Mon Oct 11 21:52:08 PDT 2004
Changes in directory llvm/test/Regression/Transforms/InstCombine:
memmove.ll added (r1.1)
---
Log message:
New testcase for memmove -> memcpy transform
---
Diffs of the changes: (+23 -0)
Index: llvm/test/Regression/Transforms/InstCombine/memmove.ll
diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/memmove.ll:1.1
*** /dev/null Mon Oct 11 23:52:05 2004
--- llvm/test/Regression/Transforms/InstCombine/memmove.ll Mon Oct 11 23:51:55 2004
***************
*** 0 ****
--- 1,23 ----
+ ; This test makes sure that memmove instructions are properly eliminated.
+ ;
+
+ ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'call void %llvm.memmove'
+
+ %S = internal constant [33 x sbyte] c"panic: restorelist inconsistency\00"
+
+ implementation
+
+ declare void %llvm.memmove(sbyte*, sbyte*, uint, uint)
+
+ void %test1(sbyte* %A, sbyte* %B, uint %N) {
+ ;; 0 bytes -> noop.
+ call void %llvm.memmove(sbyte* %A, sbyte* %B, uint 0, uint 1)
+ ret void
+ }
+
+ void %test2(sbyte *%A, uint %N) {
+ ;; dest can't alias source since we can't write to source!
+ call void %llvm.memmove(sbyte* %A, sbyte* getelementptr ([33 x sbyte]* %S, int 0, int 0),
+ uint %N, uint 1)
+ ret void
+ }
More information about the llvm-commits
mailing list