Index: docs/LangRef.rst =================================================================== --- docs/LangRef.rst +++ docs/LangRef.rst @@ -5691,8 +5691,8 @@ :: - = load [volatile] , * [, align ][, !nontemporal !][, !invariant.load !][, !nonnull !][, !dereferenceable !][, !dereferenceable_or_null !] - = load atomic [volatile] * [singlethread] , align + = load [volatile] , * [, align ][, !nontemporal !][, !invariant.load !][, !invariant.group !][, !nonnull !][, !dereferenceable !][, !dereferenceable_or_null !] + = load atomic [volatile] * [singlethread] , align [, !invariant.group !] ! = !{ i32 1 } Overview: @@ -5748,11 +5748,18 @@ but it does imply that once the location is known dereferenceable its value is henceforth unchanging. +The optional ``!invariant.group`` metadata must referenece a +single metadata name ```` corresponding to a metadata node with +no entries. The existance of the ``!invariant.group`` metadata on the +instruction tells the optimizer that every load and store to the same pointer +value, that have the same ```` loados or stores the same value +(unless optimizer see @llvm.invariant.barrier() called between loads). + The optional ``!nonnull`` metadata must reference a single metadata name ```` corresponding to a metadata node with no entries. The existence of the ``!nonnull`` metadata on the instruction tells the optimizer that the value loaded is known to -never be null. This is analogous to the ''nonnull'' attribute +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. @@ -5805,8 +5812,8 @@ :: - store [volatile] , * [, align ][, !nontemporal !] ; yields void - store atomic [volatile] , * [singlethread] , align ; yields void + store [volatile] , * [, align ][, !nontemporal !][, !invariant.group.barrier !] ; yields void + store atomic [volatile] , * [singlethread] , align [, !invariant.group.barrier !] ; yields void Overview: """"""""" @@ -5853,6 +5860,13 @@ instructions to save cache bandwidth, such as the MOVNT instruction on x86. +The optional ``!invariant.group`` metadata must referenece a +single metadata name ```` corresponding to a metadata node with +no entries. The existance of the ``!invariant.group`` metadata on the +instruction tells the optimizer that every load and store to the same pointer +value, that have the same ```` loados or stores the same value +(unless optimizer see @llvm.invariant.barrier() called between loads). + Semantics: """""""""" @@ -10140,6 +10154,41 @@ This class of intrinsics is designed to be generic and has no specific purpose. +'``llvm.invariant.group.barrier``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +:: + + declare i8* @llvm.invariant.group.barrier(i8* nocapture ) + +Overview: +""""""""" + +The '``llvm.invariant.group.barrier``' intrinsic specifies that given a pointer, +produces another pointer that aliases the first but which is considered different +for the purposes of load/store !invariant.group metadata. + +Arguments: +"""""""""" + +The ``llvm.invariant.group.barrier`` takes only one argument, which is +the pointer to memory that might changed. + +Semantics: +"""""""""" + +This intrinsic indicates that value of next load/store with !invariant.group +may have been changed. + +General Intrinsics +------------------ + +This class of intrinsics is designed to be generic and has no specific +purpose. + '``llvm.var.annotation``' Intrinsic ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^