[llvm-commits] [llvm] r89921 - /llvm/trunk/test/Analysis/BasicAA/modref.ll

Chris Lattner sabre at nondot.org
Wed Nov 25 18:16:28 PST 2009


Author: lattner
Date: Wed Nov 25 20:16:28 2009
New Revision: 89921

URL: http://llvm.org/viewvc/llvm-project?rev=89921&view=rev
Log:
add a new random feature test

Modified:
    llvm/trunk/test/Analysis/BasicAA/modref.ll

Modified: llvm/trunk/test/Analysis/BasicAA/modref.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/modref.ll?rev=89921&r1=89920&r2=89921&view=diff

==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/modref.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/modref.ll Wed Nov 25 20:16:28 2009
@@ -4,6 +4,7 @@
 declare void @llvm.memset.i32(i8*, i8, i32, i32)
 declare void @llvm.memset.i8(i8*, i8, i8, i32)
 declare void @llvm.memcpy.i8(i8*, i8*, i8, i32)
+declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
 declare void @llvm.lifetime.end(i64, i8* nocapture)
 
 declare void @external(i32*) 
@@ -94,7 +95,7 @@
 @G1 = external global i32
 @G2 = external global [4000 x i32]
 
-define i32 @test4(i8* %P, i8 %X) {
+define i32 @test4(i8* %P) {
   %tmp = load i32* @G1
   call void @llvm.memset.i32(i8* bitcast ([4000 x i32]* @G2 to i8*), i8 0, i32 4000, i32 1)
   %tmp2 = load i32* @G1
@@ -107,3 +108,18 @@
 ; CHECK: sub i32 %tmp, %tmp
 }
 
+; Verify that basicaa is handling variable length memcpy, knowing it doesn't
+; write to G1.
+define i32 @test5(i8* %P, i32 %Len) {
+  %tmp = load i32* @G1
+  call void @llvm.memcpy.i32(i8* bitcast ([4000 x i32]* @G2 to i8*), i8* bitcast (i32* @G1 to i8*), i32 %Len, i32 1)
+  %tmp2 = load i32* @G1
+  %sub = sub i32 %tmp2, %tmp
+  ret i32 %sub
+; CHECK: @test5
+; CHECK: load i32* @G
+; CHECK: memcpy.i32
+; CHECK-NOT: load
+; CHECK: sub i32 %tmp, %tmp
+}
+





More information about the llvm-commits mailing list