diff options
| author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-05-19 20:10:19 +0000 |
|---|---|---|
| committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-05-19 20:10:19 +0000 |
| commit | f999547d11249ff13853683d5ca63383593ef4fd (patch) | |
| tree | e63c5ec16e1e0b2a27ad3a86234090570d9f1f82 /llvm/docs | |
| parent | 03abbb48a43840bc6d102b94a000a1c09fe036d7 (diff) | |
| download | bcm5719-llvm-f999547d11249ff13853683d5ca63383593ef4fd.tar.gz bcm5719-llvm-f999547d11249ff13853683d5ca63383593ef4fd.zip | |
Dereferenceable, dereferenceable_or_null metadata for loads
Summary:
Introduce dereferenceable, dereferenceable_or_null metadata for loads
with the same semantic as corresponding attributes.
This patch depends on http://reviews.llvm.org/D9253
Patch by Artur Pilipenko!
Reviewers: hfinkel, sanjoy, reames
Reviewed By: sanjoy, reames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9365
llvm-svn: 237720
Diffstat (limited to 'llvm/docs')
| -rw-r--r-- | llvm/docs/LangRef.rst | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index 48ac8fbc7db..1ee16f866d6 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -5658,7 +5658,7 @@ Syntax: :: - <result> = load [volatile] <ty>, <ty>* <pointer>[, align <alignment>][, !nontemporal !<index>][, !invariant.load !<index>][, !nonnull !<index>] + <result> = load [volatile] <ty>, <ty>* <pointer>[, align <alignment>][, !nontemporal !<index>][, !invariant.load !<index>][, !nonnull !<index>][, !dereferenceable !<index>][, !dereferenceable_or_null !<index>] <result> = load atomic [volatile] <ty>* <pointer> [singlethread] <ordering>, align <alignment> !<index> = !{ i32 1 } @@ -5723,6 +5723,25 @@ never be null. This is analogous to the ''nonnull'' attribute on parameters and return values. This metadata can only be applied to loads of a pointer type. +The optional ``!dereferenceable`` metadata must reference a single +metadata name ``<index>`` corresponding to a metadata node with one ``i64`` +entry. The existence of the ``!dereferenceable`` metadata on the instruction +tells the optimizer that the value loaded is known to be dereferenceable. +The number of bytes known to be dereferenceable is specified by the integer +value in the metadata node. This is analogous to the ''dereferenceable'' +attribute on parameters and return values. This metadata can only be applied +to loads of a pointer type. + +The optional ``!dereferenceable_or_null`` metadata must reference a single +metadata name ``<index>`` corresponding to a metadata node with one ``i64`` +entry. The existence of the ``!dereferenceable_or_null`` metadata on the +instruction tells the optimizer that the value loaded is known to be either +dereferenceable or null. +The number of bytes known to be dereferenceable is specified by the integer +value in the metadata node. This is analogous to the ''dereferenceable_or_null'' +attribute on parameters and return values. This metadata can only be applied +to loads of a pointer type. + Semantics: """""""""" |

