diff --git a/docs/BitCodeFormat.rst b/docs/BitCodeFormat.rst index 065f9c3d49d..6e491c6e285 100644 --- a/docs/BitCodeFormat.rst +++ b/docs/BitCodeFormat.rst @@ -1067,6 +1067,7 @@ The integer codes are mapped to well-known attributes as follows. * code 65: ``preallocated`` * code 66: ``no_merge`` * code 67: ``null_pointer_is_valid`` +* code 68: ``noundef`` .. note:: The ``allocsize`` attribute has a special encoding for its arguments. Its two diff --git a/docs/LangRef.rst b/docs/LangRef.rst index cc2f6d1b3a0..566d761d307 100644 --- a/docs/LangRef.rst +++ b/docs/LangRef.rst @@ -1252,6 +1252,12 @@ Currently, only the following parameter attributes are defined: only valid on intrinsic declarations and cannot be applied to a call site or arbitrary function. +``noundef`` + This attribute applies to parameters and return values. If the value + representation contains any undefined or poison bits, the behavior is + undefined. Note that this does not refer to padding introduced by the + type's storage representation. + .. _gc: Garbage Collector Strategy Names @@ -3657,6 +3663,11 @@ behavior. Notably this includes (but is not limited to): - The condition operand of a :ref:`br ` instruction. - The callee operand of a :ref:`call ` or :ref:`invoke ` instruction. +- The parameter operand of a :ref:`call ` or :ref:`invoke ` + instruction, when the function or invoking call site has a ``noundef`` + attribute in the corresponding position. +- The operand of a :ref:`ret ` instruction if the function or invoking + call site has a `noundef` attribute in the return value position. Here are some examples: