diff options
author | Owen Anderson <resistor@mac.com> | 2009-10-28 06:30:52 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-10-28 06:30:52 +0000 |
commit | a85a66423d966bf6210daf9587dba7ec1ff8d64e (patch) | |
tree | c531f5d0d77e310954c17caf19b4d23ee515b742 /test | |
parent | 89321166da67fb688e94ab9e5ad0c40de4a18cdb (diff) | |
download | llvm-a85a66423d966bf6210daf9587dba7ec1ff8d64e.tar.gz llvm-a85a66423d966bf6210daf9587dba7ec1ff8d64e.tar.bz2 llvm-a85a66423d966bf6210daf9587dba7ec1ff8d64e.tar.xz |
Be more careful about invariance reasoning on "store" queries. Stores still need
to depend on Ref and ModRef calls within the invariant region.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85380 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/GVN/invariant-simple.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Transforms/GVN/invariant-simple.ll b/test/Transforms/GVN/invariant-simple.ll index c3ff353833..6de75f1435 100644 --- a/test/Transforms/GVN/invariant-simple.ll +++ b/test/Transforms/GVN/invariant-simple.ll @@ -16,6 +16,21 @@ entry: ret i8 %2 } +define i8 @test2(i8* %P) nounwind { +; CHECK: @test2 +; CHECK: store i8 1 +; CHECK: store i8 2 +; CHECK: ret i8 0 +entry: + store i8 1, i8* %P + %0 = call {}* @llvm.invariant.start(i64 32, i8* %P) + %1 = tail call i32 @bar(i8* %P) + call void @llvm.invariant.end({}* %0, i64 32, i8* %P) + store i8 2, i8* %P + ret i8 0 +} + declare i32 @foo(i8*) nounwind +declare i32 @bar(i8*) nounwind readonly declare {}* @llvm.invariant.start(i64 %S, i8* nocapture %P) readonly declare void @llvm.invariant.end({}* %S, i64 %SS, i8* nocapture %P)
\ No newline at end of file |