[llvm] b2c5060 - [LangRef] Clarify cttz.elts returns poison for undersized result types (#206970)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 2 01:07:55 PDT 2026


Author: Zhige Chen
Date: 2026-07-02T16:07:49+08:00
New Revision: b2c506061f8f05dcc6c4c03a9e7cfdfc82377c12

URL: https://github.com/llvm/llvm-project/commit/b2c506061f8f05dcc6c4c03a9e7cfdfc82377c12
DIFF: https://github.com/llvm/llvm-project/commit/b2c506061f8f05dcc6c4c03a9e7cfdfc82377c12.diff

LOG: [LangRef] Clarify cttz.elts returns poison for undersized result types (#206970)

Update the LangRef for `llvm.experimental.cttz.elts` and
`llvm.vp.cttz.elts` to state that an undersized return type produces
poison rather than UB, matching the intrinsic's speculatable behavior.

See also
https://github.com/llvm/llvm-project/pull/206899#discussion_r3504289653.

Added: 
    

Modified: 
    llvm/docs/LangRef.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 4d880494eb449..c7e5d6df0e0d4 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -22221,7 +22221,7 @@ Arguments:
 The first argument is the vector to be counted. This argument must be a vector
 with integer element type. The return type must also be an integer type which is
 wide enough to hold the maximum number of elements of the source vector. The
-behavior of this intrinsic is undefined if the return type is not wide enough
+result is a :ref:`poison value <poisonvalues>` if the return type is not wide enough
 for the number of elements in the input vector.
 
 The second argument is a constant flag that indicates whether the intrinsic
@@ -27737,7 +27737,7 @@ Arguments:
 The first argument is the vector to be counted. This argument must be a vector
 with integer element type. The return type must also be an integer type which is
 wide enough to hold the maximum number of elements of the source vector. The
-behavior of this intrinsic is undefined if the return type is not wide enough
+result is a :ref:`poison value <poisonvalues>` if the return type is not wide enough
 for the number of elements in the input vector.
 
 The second argument is a constant flag that indicates whether the intrinsic


        


More information about the llvm-commits mailing list