summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit15a43965ac9a5c6f17f99ebee7347e86e7846884 (patch)
treebf553b8e36ac91c3e3b38fa0682d9b725b3f9963 /llvm/test/Analysis
parent310c5a8e317f2f31f2df41a1ab75e74d70f8d76a (diff)
downloadbcm5719-llvm-15a43965ac9a5c6f17f99ebee7347e86e7846884.tar.gz
bcm5719-llvm-15a43965ac9a5c6f17f99ebee7347e86e7846884.zip
Teach memdep to use pointsToConstantMemory to determine that loads
from constant memory don't alias any stores. llvm-svn: 117636
Diffstat (limited to 'llvm/test/Analysis')
-rw-r--r--llvm/test/Analysis/TypeBasedAliasAnalysis/dse.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/Analysis/TypeBasedAliasAnalysis/dse.ll b/llvm/test/Analysis/TypeBasedAliasAnalysis/dse.ll
index 180149a7ad1..09a7f2c3b78 100644
--- a/llvm/test/Analysis/TypeBasedAliasAnalysis/dse.ll
+++ b/llvm/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.
OpenPOWER on IntegriCloud