summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/FunctionAttrs
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-05-25 05:53:04 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-05-25 05:53:04 +0000
commit124bdb7497e65f6606635e8ca7adbab0dd2ce07e (patch)
tree06e9d61c621ed0d0ede1d109580cf18948a7c2f6 /llvm/test/Transforms/FunctionAttrs
parent7c1841a55ed33792f14f96eb2a2f4dc030bd99c2 (diff)
downloadbcm5719-llvm-124bdb7497e65f6606635e8ca7adbab0dd2ce07e.tar.gz
bcm5719-llvm-124bdb7497e65f6606635e8ca7adbab0dd2ce07e.zip
[FunctionAttrs] Volatile loads should disable readonly
A volatile load has side effects beyond what callers expect readonly to signify. For example, it is not safe to reorder two function calls which each perform a volatile load to the same memory location. llvm-svn: 270671
Diffstat (limited to 'llvm/test/Transforms/FunctionAttrs')
-rw-r--r--llvm/test/Transforms/FunctionAttrs/readattrs.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/test/Transforms/FunctionAttrs/readattrs.ll b/llvm/test/Transforms/FunctionAttrs/readattrs.ll
index 4626cb19748..ed2a8aa07ae 100644
--- a/llvm/test/Transforms/FunctionAttrs/readattrs.ll
+++ b/llvm/test/Transforms/FunctionAttrs/readattrs.ll
@@ -104,3 +104,11 @@ define <4 x i32> @test12_2(<4 x i32*> %ptrs) {
%res = call <4 x i32> @test12_1(<4 x i32*> %ptrs)
ret <4 x i32> %res
}
+
+; CHECK: define i32 @volatile_load(
+; CHECK-NOT: readonly
+; CHECK: ret
+define i32 @volatile_load(i32* %p) {
+ %load = load volatile i32, i32* %p
+ ret i32 %load
+}
OpenPOWER on IntegriCloud