summaryrefslogtreecommitdiff
path: root/test/Analysis
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-10-29 01:14:04 +0000
committerDan Gohman <gohman@apple.com>2010-10-29 01:14:04 +0000
commitcd5c123a1d8723dbd5d493210c0a56890bffe409 (patch)
tree143c7635e0e62379d3af28da94ffe7bd14ade69c /test/Analysis
parent1cfb04390157cdba29216e0bbc2f396124ae14a1 (diff)
downloadllvm-cd5c123a1d8723dbd5d493210c0a56890bffe409.tar.gz
llvm-cd5c123a1d8723dbd5d493210c0a56890bffe409.tar.bz2
llvm-cd5c123a1d8723dbd5d493210c0a56890bffe409.tar.xz
Teach memdep to use pointsToConstantMemory to determine that loads
from constant memory don't alias any stores. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117636 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/TypeBasedAliasAnalysis/dse.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Analysis/TypeBasedAliasAnalysis/dse.ll b/test/Analysis/TypeBasedAliasAnalysis/dse.ll
index 180149a7ad..09a7f2c3b7 100644
--- a/test/Analysis/TypeBasedAliasAnalysis/dse.ll
+++ b/test/Analysis/TypeBasedAliasAnalysis/dse.ll
@@ -25,6 +25,29 @@ define i8 @test0_no(i8* %a, i8* %b) nounwind {
ret i8 %y
}
+; CHECK: @test1_yes
+; CHECK-NEXT: load i8* %b
+; CHECK-NEXT: store i8 1, i8* %a
+; CHECK-NEXT: ret i8 %y
+define i8 @test1_yes(i8* %a, i8* %b) nounwind {
+ store i8 0, i8* %a
+ %y = load i8* %b, !tbaa !5
+ store i8 1, i8* %a
+ ret i8 %y
+}
+
+; CHECK: @test1_no
+; CHECK-NEXT: store i8 0, i8* %a
+; CHECK-NEXT: load i8* %b
+; CHECK-NEXT: store i8 1, i8* %a
+; CHECK-NEXT: ret i8 %y
+define i8 @test1_no(i8* %a, i8* %b) nounwind {
+ store i8 0, i8* %a
+ %y = load i8* %b, !tbaa !6
+ store i8 1, i8* %a
+ ret i8 %y
+}
+
; Root note.
!0 = metadata !{ }
; Some type.