diff options
author | Dan Gohman <gohman@apple.com> | 2010-10-29 01:14:04 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-10-29 01:14:04 +0000 |
commit | cd5c123a1d8723dbd5d493210c0a56890bffe409 (patch) | |
tree | 143c7635e0e62379d3af28da94ffe7bd14ade69c /test/Analysis | |
parent | 1cfb04390157cdba29216e0bbc2f396124ae14a1 (diff) | |
download | external_llvm-cd5c123a1d8723dbd5d493210c0a56890bffe409.zip external_llvm-cd5c123a1d8723dbd5d493210c0a56890bffe409.tar.gz external_llvm-cd5c123a1d8723dbd5d493210c0a56890bffe409.tar.bz2 |
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.ll | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Analysis/TypeBasedAliasAnalysis/dse.ll b/test/Analysis/TypeBasedAliasAnalysis/dse.ll index 180149a..09a7f2c 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. |