From e62b2633e8c782f8805bbcb13d92179f179d6143 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 18 Oct 2009 04:55:26 +0000 Subject: tighten up test3, add test3a for the converse transform, which isn't happening yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84402 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Analysis/BasicAA/modref.ll | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'test/Analysis') diff --git a/test/Analysis/BasicAA/modref.ll b/test/Analysis/BasicAA/modref.ll index a089864..07d73a7 100644 --- a/test/Analysis/BasicAA/modref.ll +++ b/test/Analysis/BasicAA/modref.ll @@ -51,7 +51,10 @@ define i8 @test2(i8* %P) { define i8 @test2a(i8* %P) { ; CHECK: @test2 %P2 = getelementptr i8* %P, i32 126 + + ;; FIXME: DSE isn't zapping this dead store. store i8 1, i8* %P2 ;; Dead, clobbered by memset. + call void @llvm.memset.i8(i8* %P, i8 2, i8 127, i32 0) %A = load i8* %P2 ret i8 %A @@ -59,14 +62,30 @@ define i8 @test2a(i8* %P) { ; CHECK: ret i8 %A } -define void @test3(i8* %P) { +define void @test3(i8* %P, i8 %X) { ; CHECK: @test3 +; CHECK-NOT: store +; CHECK-NOT: %Y + %Y = add i8 %X, 1 ;; Dead, because the only use (the store) is dead. + %P2 = getelementptr i8* %P, i32 2 - store i8 1, i8* %P2 ;; Not read by lifetime.end -; CHECK: store + store i8 %Y, i8* %P2 ;; Not read by lifetime.end, should be removed. +; CHECK: store i8 2, i8* %P2 call void @llvm.lifetime.end(i64 1, i8* %P) store i8 2, i8* %P2 ; CHECK-NOT: store ret void ; CHECK: ret void +} + +define void @test3a(i8* %P, i8 %X) { +; CHECK: @test3a + %Y = add i8 %X, 1 ;; Dead, because the only use (the store) is dead. + + %P2 = getelementptr i8* %P, i32 2 + store i8 %Y, i8* %P2 ;; FIXME: Killed by llvm.lifetime.end, should be zapped. +; CHECK: store i8 2, i8* %P2 + call void @llvm.lifetime.end(i64 10, i8* %P) + ret void +; CHECK: ret void } \ No newline at end of file -- cgit v1.1