[llvm] [IR] Add new Range attribute using new ConstantRange Attribute type (PR #83171)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 09:17:21 PST 2024


================
@@ -1634,6 +1634,23 @@ Currently, only the following parameter attributes are defined:
 
     This attribute cannot be applied to return values.
 
+``range(<ty> <a>, <b>)``
+    This attribute expresses the possible range the parameter is in. The value of 
+    the parameter is in the specified range or is poison.
+    The arguments passed to ``range`` has the following properties:
+
+-  The type must match the scalar type of the parameter.
+-  The pair ``a,b`` represents the range ``[a,b)``.
+-  Both ``a`` and ``b`` are constants.
+-  The range is allowed to wrap.
+-  The range should not represent the full or empty set. That is,
+   ``a!=b``.
----------------
nikic wrote:

Incorrect indentation in the block above?

https://github.com/llvm/llvm-project/pull/83171


More information about the llvm-commits mailing list