summaryrefslogtreecommitdiffstats
path: root/llvm/test/Bitcode
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2014-07-18 15:51:28 +0000
committerHal Finkel <hfinkel@anl.gov>2014-07-18 15:51:28 +0000
commitb0407ba0716d940d035f5da73f6d3bfbaffecb44 (patch)
tree0fb08700ec2601986a9f5195a9d57fb6e0b48444 /llvm/test/Bitcode
parent9cf7ac75893c9f83099ce59dd4fd5d1ba7ead25a (diff)
downloadbcm5719-llvm-b0407ba0716d940d035f5da73f6d3bfbaffecb44.tar.gz
bcm5719-llvm-b0407ba0716d940d035f5da73f6d3bfbaffecb44.zip
Add a dereferenceable attribute
This attribute indicates that the parameter or return pointer is dereferenceable. Practically speaking, loads from such a pointer within the associated byte range are safe to speculatively execute. Such pointer parameters are common in source languages (C++ references, for example). llvm-svn: 213385
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r--llvm/test/Bitcode/attributes.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/attributes.ll b/llvm/test/Bitcode/attributes.ll
index 49366de9836..2490e592072 100644
--- a/llvm/test/Bitcode/attributes.ll
+++ b/llvm/test/Bitcode/attributes.ll
@@ -229,6 +229,16 @@ define void @f38() unnamed_addr jumptable {
unreachable
}
+define dereferenceable(2) i8* @f39(i8* dereferenceable(1) %a) {
+; CHECK: define dereferenceable(2) i8* @f39(i8* dereferenceable(1) %a) {
+ ret i8* %a
+}
+
+define dereferenceable(18446744073709551606) i8* @f40(i8* dereferenceable(18446744073709551615) %a) {
+; CHECK: define dereferenceable(18446744073709551606) i8* @f40(i8* dereferenceable(18446744073709551615) %a) {
+ ret i8* %a
+}
+
; CHECK: attributes #0 = { noreturn }
; CHECK: attributes #1 = { nounwind }
; CHECK: attributes #2 = { readnone }
OpenPOWER on IntegriCloud