summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/GVN/invariant-simple.ll
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-10-28 06:30:52 +0000
committerOwen Anderson <resistor@mac.com>2009-10-28 06:30:52 +0000
commitfc16e5a98f691d3fb290f30f5089c48764de372e (patch)
tree62cfc8d623d931069bab25aa744621b6cda227ec /llvm/test/Transforms/GVN/invariant-simple.ll
parentf64db3e1d05b76e045b0700bfff4476574c00df0 (diff)
downloadbcm5719-llvm-fc16e5a98f691d3fb290f30f5089c48764de372e.tar.gz
bcm5719-llvm-fc16e5a98f691d3fb290f30f5089c48764de372e.zip
Be more careful about invariance reasoning on "store" queries. Stores still need
to depend on Ref and ModRef calls within the invariant region. llvm-svn: 85380
Diffstat (limited to 'llvm/test/Transforms/GVN/invariant-simple.ll')
-rw-r--r--llvm/test/Transforms/GVN/invariant-simple.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/Transforms/GVN/invariant-simple.ll b/llvm/test/Transforms/GVN/invariant-simple.ll
index c3ff353833b..6de75f14350 100644
--- a/llvm/test/Transforms/GVN/invariant-simple.ll
+++ b/llvm/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
OpenPOWER on IntegriCloud