[llvm-commits] [parallel] CVS: llvm/test/Regression/Analysis/DSGraph/2004-02-13-memcpy.ll constant_globals.ll strcpy.ll

Misha Brukman brukman at cs.uiuc.edu
Mon Mar 1 20:39:40 PST 2004


Changes in directory llvm/test/Regression/Analysis/DSGraph:

2004-02-13-memcpy.ll added (r1.2.2.1)
constant_globals.ll added (r1.1.2.1)
strcpy.ll added (r1.1.2.1)

---
Log message:

Merge from trunk

---
Diffs of the changes:  (+69 -0)

Index: llvm/test/Regression/Analysis/DSGraph/2004-02-13-memcpy.ll
diff -c /dev/null llvm/test/Regression/Analysis/DSGraph/2004-02-13-memcpy.ll:1.2.2.1
*** /dev/null	Mon Mar  1 17:59:24 2004
--- llvm/test/Regression/Analysis/DSGraph/2004-02-13-memcpy.ll	Mon Mar  1 17:59:14 2004
***************
*** 0 ****
--- 1,13 ----
+ ; RUN: analyze %s -datastructure-gc -dsgc-check-flags=X:SMR
+ 
+ declare void %llvm.memcpy(sbyte*, sbyte*, uint, uint)
+ 
+ void %test() {
+ 	%X = alloca int
+ 	%Y = alloca int
+ 	%x = cast int* %X to sbyte*
+ 	%y = cast int* %Y to sbyte*
+ 	store int 4, int* %X
+ 	call void %llvm.memcpy(sbyte* %x, sbyte* %y, uint 4, uint 4)
+ 	ret void
+ }


Index: llvm/test/Regression/Analysis/DSGraph/constant_globals.ll
diff -c /dev/null llvm/test/Regression/Analysis/DSGraph/constant_globals.ll:1.1.2.1
*** /dev/null	Mon Mar  1 17:59:24 2004
--- llvm/test/Regression/Analysis/DSGraph/constant_globals.ll	Mon Mar  1 17:59:14 2004
***************
*** 0 ****
--- 1,22 ----
+ ; RUN: analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=A:SM
+ ; Constant globals should not mark stuff incomplete.  This should allow the 
+ ; bu pass to resolve the indirect call immediately in "test", allowing %A to
+ ; be marked complete and the store to happen.
+ 
+ ; This is the common case for handling vtables aggressively.
+ 
+ %G = constant void (int*)* %foo 
+ 
+ implementation
+ 
+ void %foo(int *%X) {
+   store int 0, int* %X
+   ret void
+ }
+ 
+ void %test() {
+   %Fp = load void (int*)** %G
+   %A = alloca int
+   call void %Fp(int* %A)
+   ret void
+ }


Index: llvm/test/Regression/Analysis/DSGraph/strcpy.ll
diff -c /dev/null llvm/test/Regression/Analysis/DSGraph/strcpy.ll:1.1.2.1
*** /dev/null	Mon Mar  1 17:59:24 2004
--- llvm/test/Regression/Analysis/DSGraph/strcpy.ll	Mon Mar  1 17:59:14 2004
***************
*** 0 ****
--- 1,34 ----
+ ; We know that strcpy cannot be used to copy pointer values, because
+ ; pointers might contain null bytes and would stop the copy.  The code
+ ; has no defined way to check for this, so DSA can know that strcpy doesn't
+ ; require merging the input arguments.
+ 
+ ; RUN: analyze %s -datastructure-gc --dsgc-abort-if-merged=A,B --dsgc-check-flags=A:SM,B:SR --dsgc-dspass=bu
+ 
+ implementation
+ 
+ internal void %strcpy(sbyte* %s1, sbyte* %s2) {
+ entry:
+         br label %loopentry
+ 
+ loopentry:              ; preds = %entry, %loopentry
+         %cann-indvar = phi uint [ 0, %entry ], [ %next-indvar, %loopentry ]             ; <uint> [#uses=2]
+         %cann-indvar1 = cast uint %cann-indvar to long          ; <long> [#uses=2]
+         %s1_addr.0 = getelementptr sbyte* %s1, long %cann-indvar1               ; <sbyte*> [#uses=1]
+         %s2_addr.0 = getelementptr sbyte* %s2, long %cann-indvar1               ; <sbyte*> [#uses=1]
+         %next-indvar = add uint %cann-indvar, 1         ; <uint> [#uses=1]
+         %tmp.3 = load sbyte* %s2_addr.0         ; <sbyte> [#uses=2]
+         store sbyte %tmp.3, sbyte* %s1_addr.0
+         %tmp.4 = setne sbyte %tmp.3, 0          ; <bool> [#uses=1]
+         br bool %tmp.4, label %loopentry, label %loopexit
+ 
+ loopexit:               ; preds = %loopentry
+         ret void
+ }
+ 
+ int %main() {
+ 	%A = alloca sbyte
+ 	%B = alloca sbyte
+ 	call void %strcpy(sbyte* %A, sbyte* %B)
+ 	ret int 0
+ }





More information about the llvm-commits mailing list